Scalable multiprocessor system and cache coherence method incorporating invalid-to-dirty requests

ABSTRACT

An invalid-to-dirty request permits a transition from an invalid memory state to a dirty state without requiring an up-to-date copy of the memory. The present invention is a system for supporting invalid-to-dirty memory transactions in an aggressive cache coherence protocol that minimizes directory entry locking. The nodes of a multiprocessor system each include a protocol engine that is configured to implement a distinct invalidation request that corresponds to an invalid-to-dirty memory transaction. If node O receives this distinct invalidation request while waiting for a response to an outstanding request for exclusive ownership, the protocol engine of node O is configured to treat the distinct invalidation request as applying to the memory line of information that is the subject of the outstanding request for exclusive ownership. Furthermore, if the node O receives a normal invalidation request, while it has an outstanding exclusive request, the invalidation request applies to a previous copy of the memory line of information held by the node N and therefore the protocol engine of node O is configured to ignore the normal invalidation request in this circumstance.

This application is a continuation-in-part of U.S. patent applicationSer. No. 09/878,982, Now U.S. Pat. No. 20020002443 filed Jun. 11, 2001,Scalable Multiprocessor System And Cache Coherence Method, which claimedpriority on U.S. provisional patent application serial No. 60/210,675,filed Jun. 10, 2000.

RELATED APPLICATIONS

This application is related to, and hereby incorporates by reference,the following U.S. patent applications:

Multiprocessor Cache Coherence System And Method in Which ProcessorNodes And Input/output Nodes Are Equal Participants, Ser. No.09/878,984, filed Jun. 11, 2001;

Scalable Multiprocessor System And Cache Coherence Method, Ser. No.09/878,982, filed Jun. 11, 2001;

System and Method for Daisy Chaining Cache Invalidation Requests in aShared-memory Multiprocessor System, Ser. No. 09/878,985, filed Jun. 11,2001;

Cache Coherence Protocol Engine And Method For Processing MemoryTransaction in Distinct Address Subsets During Interleaved Time Periodsin a Multiprocessor System, Ser. No. 09/878,983, filed Jun. 11, 2001;

System And Method For Generating Cache Coherence Directory Entries AndError Correction Codes in a Multiprocessor System, Ser. No. 09/972,477,filed Oct. 5, 2001, which claims priority on U.S. provisional patentapplication No. 60/238,330, filed Oct. 5, 2000, which is also herebyincorporated by reference in its entirety.

FIELD OF INVENTION

The present invention relates generally to multiprocessor computersystem, and particularly to a multiprocessor system designed to behighly scalable, using efficient cache coherence logic and methodologiesthat support cache-state transitions from invalid to dirty.

BACKGROUND OF THE INVENTION

Large-scale multiprocessor systems typically use a directory-based cachecoherence protocol. A directory is a cache coherence protocol datastructure that tracks which nodes in a given large-scale multiprocessorsystem are caching a memory line of information maintained in thesystem. This information is used by the cache coherence protocol toinvalidate cached copies of a memory line of information when thecontents of the memory line of information are modified.

Many cache coherence protocol operations require an update of acorresponding directory entry, because they affect the cached copies ofa memory line of information that is the subject of the operation.Furthermore, since a particular cache coherence protocol operation mayaffect many nodes, the operation must be executed in distributed fashionwhile still updating the directory entry correctly.

One way of achieving this effect is to “lock” a directory entry while anoperation is in progress. The directory entry is unlocked after anacknowledgment message has been received from each node affected by theoperation. For example, when a number of cached copies of a memory lineof information are to be invalidated, the home node locks the directoryentry, sends an invalidation message to each node caching a copy of thememory line of information, and updates and unlocks the directory entryonly when acknowledgment messages have been received from each of thesenodes. While the directory entry is locked, the home node blocks anyother operations on the corresponding memory line of information.

More aggressive cache coherence protocols attempt to minimize thelocking of directory entries by “optimistically” updating a directoryentry with the expected results of an operation and leaving thedirectory entry unlocked. The directory entry may, therefore, have to beadjusted when the home node determines that an operation did not occurexactly as planned. In addition, nodes must deal with the problem thatrequest messages for two consecutive operations of a memory line ofinformation may be received out-of-order. In particular, a node O musthandle the case of an “early-request” race, in which node O requests acopy of a memory line of information, but receives a request to performan operation on the memory line of information before it has receivedthe copy of the memory line of information. This problem can arisebecause the home node updates the corresponding directory entry toindicate that node O has an exclusive copy of the memory line ofinformation at about the same time that the home node sends the copy ofthe memory line of information to node O and, therefore, before node Ohas actually received the copy of the memory line of information. It ispossible that the home node could subsequently process a requestconcerning the same memory line of information and send a relatedmessage that is received by node O before the copy of the memory line ofinformation.

There is needed in the art, therefore, a system for dealing with theabove described early request race when a cache coherence protocolsupports an “invalid-to-dirty” memory transaction. The“invalid-to-dirty” memory transaction includes a request to a home nodefor exclusive ownership on a memory line of information but not thecontents of the memory line of information. This request is useful whenthe requester intends to write the entire contents of the line andtherefore does not need the contents of the memory line of information.

SUMMARY OF THE INVENTION

The present invention is a system for supporting invalid-to-dirty memorytransactions in an aggressive cache coherence protocol that minimizesdirectory entry locking. More specifically, the nodes of amultiprocessor system each include a protocol engine that is configuredto implement a distinct invalidation request that corresponds to aninvalid-to-dirty memory transaction. If node O receives this distinctinvalidation request while waiting for a response to an outstandingrequest for exclusive ownership, the protocol engine of node O isconfigured to treats the distinct invalidation request as applying tothe memory line of information that is the subject of the outstandingrequest for exclusive ownership. Furthermore, if the node O receives anormal invalidation request, while it has an outstanding exclusiverequest, the invalidation request applies to a previous copy of thememory line of information held by the node N and therefore the protocolengine of node O is configured to ignore the normal invalidation requestin this circumstance.

BRIEF DESCRIPTION OF THE DRAWINGS

Additional objects and features of the invention will be more readilyapparent from the following detailed description and appended claimswhen taken in conjunction with the drawings, in which:

FIG. 1 is a block diagram of a multiprocessor system.

FIG. 2 is a block diagram of an input (I/O) node of the multiprocessorsystem of FIG. 1.

FIG. 3 is a block diagram of a intra-chip switch and the moduleinterfaces used to couple the modules of a system node to the intra-chipswitch.

FIG. 4 depicts a directory data structure for keeping track of whichnodes of the system have copies of each line of memory data.

FIG. 5 is a block diagram of a protocol engine.

FIG. 6A depicts the instruction format of the instructions executed inone embodiment of the protocol engine of FIG. 5; FIG. 6B is a blockdiagram of a portion of the TSRF selection logic of the protocol engineof FIG. 5; and FIG. 6C depicts a subset of the fields of each TSRF entryin the Transient State Register File (TSRF) of the protocol engine ofFIG. 5.

FIG. 7A is a table indicating operations performed during Even and Oddcycles of the execution unit of the protocol engine; FIG. 7B depictsEven and Odd logical pipelines in the protocol engine that share use ofmany circuitry components; and FIG. 7C depicts a state transitiondiagram for any single one of the TSRF entries in the Transient StateRegister File (TSRF) of the protocol engine of FIG. 5.

FIG. 8 is a block diagram of a portion the execution logic of theprotocol engine of FIG. 5.

FIGS. 9A and 9B depict two embodiments of the Tag-State and Data arraysof an L1 cache.

FIG. 9C shows the architecture of the L1 cache in more detail.

FIGS. 10A and 10B depict the duplicate tag, tag-state and data arrays ofan L2 cache.

FIG. 10C shows the architecture of the L2 cache in more detail.

FIGS. 11A, 11B, 11C, 11D and 11E illustrate the exchange of protocolmessages in the course of a read request.

FIGS. 12A, 12B, 12C and 12D illustrate the exchange of protocol messagesin the course of a write request.

FIG. 13 illustrates the exchange of protocol messages in the course ofcompleting a write-back request.

FIGS. 14A and 14B illustrate the exchange of protocol messages in thecourse of executing an invalidation request when nodes are representedin a limited-pointer format or a coarse-vector format.

FIGS. 15A-15C illustrate the exchange of protocol messages in the courseof executing an invalid-to-dirty request.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

All specific quantities (such as numbers of processors, number of nodes,memory sizes, bit sizes of data structures, operating speeds ofcomponents, number of interfaces, number of memory locations in buffers,numbers of cache lines), as well as the sizes and number of componentsin various data structures, disclosed in this document, are providedsolely for purposes of explaining the operation of one particularembodiment. These quantities will typically vary, sometimessignificantly, from one implementation of the invention to another.

The following is a list of abbreviations frequently used in thedescriptions below:

CCP: cache coherence protocol;

FSM: finite state machine;

HPE: home protocol engine;

ICS: intra-chip switch;

I/O: input/output;

MC: memory controller;

PC: processor core;

RPE: remote protocol engine; and

TSRF: Transient State Register File.

Referring to FIG. 1, there is shown a multiprocessor system 100including a multiplicity of processor nodes 102 and an I/O nodes 104.Each processor node 102 is preferably implemented as a single chipmultiprocessor. In a preferred embodiment, each processor node 102 haseight processor cores (PC) 106; however, other embodiments have two tosixteen PCs 106. The PCs 106, which may be comprised of a centralprocessing unit, are processor cores since their caches, cache coherencelogic and other supporting circuitry are shown separately.

Each processor core (PC) 106 is directly connected to dedicatedinstruction cache (iL1) 108 and data cache (dL1) 110 modules. Thesefirst-level caches (L1 cache modules) 108, 110 interface to othermodules through an intra-chip switch (ICS) 112. Also connected to theICS 112 is a logically shared second level cache (L2) 114 that isinterleaved into eight separate modules 116, each with its owncontroller, on-chip tag, and data storage. Coupled to each L2 cache 116is a memory controller (MC) 118 that preferably interfaces directly to amemory bank of DRAM (dynamic random access memory) chips (not shown) ina memory subsystem 123. In a preferred embodiment, each memory bankprovides a bandwidth of 1.6 GB/sec, leading to an aggregate bandwidth of12.8 GB/sec. Also connected to the ICS 112 are two protocol engines, theHome Protocol Engine (HPE) 122 and the Remote Protocol Engine (RPE) 124,which support shared memory across multiple nodes 102, 104 of thesystem. Multiple nodes are linked by a subsystem including a router (RT)126, an input queue (IQ) 128, an output queue (OQ) 130, a packet switch(PS) 132, and a packet switched interconnect 134. The router 136 sendsand receives packets to and from other nodes via the interconnect 134.The interconnect 134 physically links multiple nodes 102, 104. In apreferred embodiment the total interconnect bandwidth (in/out) for eachnode is 32 GB/sec. Finally, a system control (SC) module 136 takes careof miscellaneous maintenance-related functions (e.g., systemconfiguration, initialization, interrupt distribution, exceptionhandling, performance monitoring).

In a preferred embodiment, the various modules communicate exclusivelythrough the connections shown in FIG. 1, which also represent the actualsignal connections. This modular approach leads to a strict hierarchicaldecomposition of the single chip used to implement each node of thesystem, which allows for the development of each module in relativeisolation along with well defined transactional interfaces and clockdomains. While each processor node 102 uses a complete multiprocessorsystem on a chip, the processor nodes 102 do not have any I/O capabilityin this embodiment.

Instead, I/O is performed by I/O nodes 104, one of which is shown inFIG. 2. Each I/O node 104 is preferably implemented as a single chipthat is relatively small in area compared to the chip used to implementthe processor nodes 102. Each I/O node 104 is a stripped-down version ofthe processor node 102 having only one PC 106, one L2 cache 116 and onememory controller module 118. The router 140 on the I/O node 104 is asimplified version of router 126 having support for only two linksinstead of four, thus eliminating the need for a routing table. The I/Onode 104 includes an I/O interface 142, called the PCI/IX interface in apreferred embodiment because it provides an interface between a PCI busand an I/O bus 144.

From the point of view of a programmer, the PC 106 on the I/O node 104is indistinguishable from a PC 106 included on the processor node 102.Similarly, memory at the 110 node 104 fully participates in the globalcache coherence scheme of the multiprocessor system 100 (FIG. 1). Thepresence of a PC 106 on the I/O node 104 provides several benefits. Forinstance, it enables optimizations such as scheduling device drivers onthis processor for lower latency access to I/O, or virtualization of theinterface to various I/O devices (e.g., by having the PC 106 interpretaccesses to virtual control registers). Except for the PCI/X interface142, most of the modules on the I/O node 104 are identical in design tothose on the processor node 102. For example, the same first-level datacache module (dL1) 110 that is used with the PCs 106 is also used tointerface to the PCI/X module 142. The dL1 module 110 also provides thePCI/X interface 142 with address translation, access to I/O spaceregisters, and interrupt generation. The I/O node 104 may also becustomized to support other I/O standards such as Fiber Channel andSystem I/O.

Referring back to FIG. 1, the multiprocessor system 100 in a preferredembodiment allows for glueless scaling up to 1023 nodes 102, 104, withan arbitrary ratio of I/O nodes 104 to processing nodes 102. The ratioof I/O nodes 104 to processor nodes 102 is adjustable to match theresource needs of any particular workload. Furthermore, the router 126,140 in each of the nodes 102, 104 supports arbitrary network topologiesand allows for dynamic reconfigurability.

The I/O nodes 104 of the system are treated the same as processor nodes102, that is, as full-fledged members of the multiprocessor system 100.In part, this design decision is based on the observation that availableinter-chip bandwidth is best invested in a single switching fabric thatforms a global resource utilized for both memory and I/O traffic.

In an alternate embodiment, one or more of the I/O nodes 104 of thesystem have no processor cores and therefore no L1 caches other than theL1 cache for the interface 142 to an I/O bus or device. Furthermore, afirst subset of the no-processor core versions of I/O nodes 104 may alsolack a memory subsystem 123, while other ones of the no-processor coreversions of the I/O nodes do include a memory subsystem 123.

Processor Core and First-Level Caches

In a preferred embodiment, the PC 106 uses a single-issue, in-orderdesign capable of executing the Alpha instruction set. It consists of a500 MHz pipelined datapath with hardware support for floating-pointoperations. The pipeline has 8 stages: instruction fetch, register-read,ALU 1 through 5, and write-back. The 5-stage ALU supports pipelinedfloating-point and multiply instructions. However, most instructionsexecute in a single cycle. The PC 106 includes several performanceenhancing features including a branch target buffer, pre-compute logicfor branch conditions, and a fully bypassed datapath. The PC 106interfaces with separate first-level instruction and data cachesdesigned for single-cycle latency.

As will be described in more detail below, the system uses 64 KB two-wayset-associative, blocking caches with virtual indices and physical tags.The L1 cache modules 108, 110 include tag compare logic, instruction anddata translation lookaside buffers (TLBs) (each storing 256 entries, ina 4-way associative caching arrangement), and a store buffer (data cacheonly). The L1 cache modules 108, 110 also maintains a 2-bit state fieldper cache line, corresponding to the four states in a typical MESIprotocol. For simplicity, the L1 instruction cache modules 108 and L1data cache modules 110 use virtually the same design. Therefore, unlikeother Alpha implementations, the instruction cache is kept coherent byhardware. Treating all cache modules 108, 110 in the same way alsosimplifies the implementation of a no-inclusion policy at the L2 level.

Intra-Chip Switch

Referring to FIG. 3, conceptually, the ICS 112 is a crossbar thatinter-connects most of the modules 150 on a processor node 102 or I/Onode 104. The ICS 112 includes a switch fabric 152 and an arbiter 154for determining which data transfer(s) to handle during each availabledata transfer period. The length of the data period depends on thenumber of transfers required to send one cache line across the ICS 112.In a preferred embodiment, each connection provided by the switch fabric152 of the ICS 112 has a path width of 64 data bits, plus eight paritybits, for a total of 72 bits. Each cache line transported through theICS 112 has 512 bits of data and sixty-four parity bits. Memory linesare transported along with the corresponding sixty-four parity bits whenthey are transported through the ICS 112. Parity bits for memory linesare also sent to and used in the L1 cache arrays. However, parity bitsare not used in the L2 cache and they are also not used in main memory.Instead, in the L2 cache, 20 ECC bits are associated with each memoryline, and more specifically a 10-bit ECC is associated with each 256-bithalf memory line. In the L2 cache and main memory, the 64 bits otherwiseavailable for use as parity bits are used instead to store the 20 ECCbits, as well as a 44-bit directory entry, which will be described inmore detail below. Data transfers generally are sent with a command ortransaction type indicator, which is transferred in parallel with thefirst 64 bits of data of the cache line. Each cache line sized datatransfer requires eight clock cycles, with 64 bits of data and aproportional share of the parity and ECC bits being transferred duringeach clock cycle.

Arbitration and flow control are handled by the arbiter 154. To betterunderstand the arbiter it is helpful to first review the interface 156presented by each module 150 (i.e., L1 cache modules 108, 110, L2 cache,protocol engine or system controller) to the ICS 112. As shown in FIG.3, the standard intra-chip interface 156 provided by each such moduleincludes one or more input buffers 160, one or more output buffers 162,a first finite state machine (FSM) 164 for controlling use of the inputbuffer(s) 160, and a second finite state machine (FSM) 166 forcontrolling use of the output buffer(s) 162. The arbiter 154, via theFSM 164, 166 of each module 150 keeps track of the availability ofbuffer space in the output buffers 162 of the modules 150 at all times,and exercises flow control by deferring requests to transfer data tomodules with full input buffers 160. The arbiter 154 also receives allintra-chip data transfer requests from the interfaces 156 of the modules150, and arbitrates between the requests whose destinations have inputbuffers 160 with sufficient room to receive a data transfer (i.e., acache line of data).

In a preferred embodiment three parallel communication lanes, alsocalled queues, are implemented in the input buffers 160 and outputbuffers 162 of the ICS interface 156, as well as in the input and outputbuffers of interfaces (not shown) to the packet switch 126 andinterconnect 134 (see FIG. 1). These lanes or queues are labeled I/O,low priority and high priority, respectively. The high priority queuesin the input and output buffers are used to store messages sent from ahome node to another node of the system, replies from third party nodesto the home node or the requester node for a particular transaction, andmessages internal to a node. The “home node” of a memory transaction isthe home node of the memory line of information that is the subject ofthe transaction. Each memory line of information has a home addresslocated in the memory subsystem local to the home node of the memoryline. The low priority queues are used to store messages going to thehome node for a particular transaction. The low priority message arethus messages for initiating new memory transactions, while the highpriority messages are messages for completing previously initiatedmemory transactions. The I/O queues are used for handling requests beingsent to I/O devices. The messages in the I/O queues are given the lowestpriority by the intrachip switch 112 and also by the packet switch 126and interconnect 134 (see FIG. 1).

The use of multiple communication lanes generally increases the size ofthe input and output buffers in the interfaces to the ICS 112, packetswitch 126 and interconnect 134. However, the use of multiplecommunication lanes is important for avoid deadlock conditions in thenetwork, and in particular for ensuring that active memory transactionsmake forward progress even when the system is experiencing high levelsof protocol message traffic. In alternate embodiments, four or morecommunication lanes are used instead of three. In particular, in onealternate embodiment the high priority lane is replaced by two separatecommunication lanes, one for messages sent from the home node of amemory transaction and the other for replies sent by third parties toeither the home node or any other node in the system. Providing theadditional communication lane helps to ensure that messages sent by thehome nodes of transactions are not blocked by reply messages being sentby the same node(s) for transactions in which those nodes are not thehome node, and vice versa.

From a philosophical viewpoint, the ICS 112 is the primary facility fordecomposing the processor node 102 and I/O node 104 into relativelyindependent, isolated modules 150. For instance, the transactionalnature of the ICS 112 and the uniformity of the interfaces 156 presentedby the modules 150 to the ICS 112 together allow different types ofmodules 150 to have different numbers of internal pipeline stages forhandling various type of memory transactions.

The ICS 112 uses a uni-directional, push-only data transfer technique.The initiator of a memory transaction always sources data. If thedestination of a transaction is ready, the arbiter 154 schedules thedata transfer according to datapath availability. A grant is issued bythe arbiter 154 to the initiator of the transaction to commence the datatransfer at a rate of one 64-bit word per cycle without any further flowcontrol. Concurrently, the destination receives a signal from thearbiter 154 that identifies the initiator and the type of transfer.Transfers across the ICS 112 are atomic operations.

Each port to the ICS 112 consists of two independent 64-bit data paths(plus additional datapath bits for eight parity bits) for sending andreceiving data. The ICS 112 supports back-to-back transfers withoutdead-cycles between transfers. In order to reduce latency, in apreferred embodiment the modules 150 are allowed to issue a“pre-request” indicating the target destination of a future request,ahead of the actual transfer request. The pre-request is used by the ICS112 to pre-allocate data paths and to speculatively assert a grantsignal to the requester.

Directory Used in Cache Coherence Protocol

Referring to FIG. 4, within each node of the system that has a memorysubsystem 123, a cache state directory 180 is maintained by the homeprotocol engine (HPE) 122. The memory subsystem 123 of a node is alsocalled the main memory array of the node. The directory 180 for a node'smemory subsystem 123 includes one directory entry 182 for each “memoryline” 184 in the memory system 123. A “memory line” is the unit ofmemory that fits into one cache line of the L1 cache modules 108, 110and L2 caches 114. In a preferred embodiment, a memory line is 512 bits(64 bytes, or eight 64-bit words) of data; however, the size of thememory line will vary from one implementation to another. Each memoryline 184 also includes two 10-bit ECC (error correction code) codes (onefor each half memory line). The 20 bits of ECC codes and the 44-bitdirectory entry 182 occupy the same amount of memory, 64 bits, as wouldbe required for one parity bit per byte. The ECC bits are used only inmain memory and the L2 cache, to detect and correct errors in retrievedmemory lines, while the directory entry is used by the home protocolengine (HPE) 122 to maintain cache coherence of the memory lines 184corresponding to the directory entries 182.

Each directory entry 182 includes a state field 186 for indicating thestate of the corresponding memory line 184, and a sharer-informationfield 188 for identifying nodes 102, 104 that have or might have ashared copy of the corresponding memory line 184. A directory entry 182in a preferred embodiment contains 44 bits, with the state field 186comprising a 2-bit field that is repeated (i.e., stored twice in eachdirectory entry 182) and the sharer-information field 188 comprising a40-bit field that is split into two 20-bit fields 188-1, 188-2. In apreferred embodiment there are two possible formats for thesharer-information field 188, with the format of the sharer-informationfield 188 in a given directory entry 182 being determined by the numberof nodes 102, 104 sharing the memory line 184 corresponding to thedirectory entry 182. Generally, a node 102, 104 is said to “share” amemory line 184 if it maintains a read-only copy of the memory line184—typically stored in a cache array 108, 110, 114 within therespective node 102, 104.

In a preferred embodiment (with a 40-bit sharer-information field and amaximum of 1023 nodes), when the number of nodes 102, 104 currentlysharing a memory line 184 is four or less, a first sharer-informationfield 188 format called the “limited-pointer” format is used. In thisformat, the 40-bit sharer-information field 188 is divided into four10-bit sub-fields, each of which is used to store a “direct nodepointer” that identifies a node 102, 104 that is a sharer of the memoryline 184. A predefined null pointer value (e.g., 0×000 or 0×3FF) isstored in one or more of the 10-bit sub-fields to indicate that therespective 10-bit field does not identify a node 102, 104 (e.g., whenfewer than four nodes 102, 104 share a memory line 184). More generally,the size of the sharer-information field 188 and the number of bitsrequired for each direct node pointer determines the maximum number (DP)of direct node pointers that a sharer-information field 188 can store.Additionally, the node pointers (i.e., identifiers) included in the10-bit sub-fields are obtained from requests to share a correspondingmemory line of information 184. Thus, each request to share a memoryline of information 184 (described in detail below), includes a 10-bitidentifier of the requesting node.

Also, in a preferred embodiment, when the number of nodes 102, 104sharing a memory line 184 is more than four, a second sharer-informationfield 188 format called the “coarse vector” format is used. In thisformat, each bit in the sharer-information field 188 corresponds to oneor more nodes 102, 104. More specifically, when the number of nodes 102,104 in the multiprocessor system 100 is more than four but less thanforty-one, each bit of the sharer-information field 188 eithercorresponds to one node 102, 104 or does not correspond to any node 102,104. Thus, a set bit (zero or one depending on the specificimplementation) in the sharer-information field 188 of a given directoryentry 182 indicates that the one node 102, 104 corresponding to the setbit shares the memory line 184 corresponding to the directory entry 182.And when the number of nodes 102, 104 in the multiprocessor system 100is more than forty, one or more of the bits in the sharer-informationfield 188 correspond to a plurality of nodes 102, 104. Thus, a set bit(zero or one depending on the specific implementation) in thesharer-information field 188 of a given directory entry 182 indicatesthat the one or more nodes 102, 104 corresponding to the set bit sharethe memory line 184 corresponding to the directory entry 182.

Because only one bit is used to identify one or more nodes 102, 104 whenthe sharer-information field 188 is in the coarse-vector format, eachnode 102, 104 in the multiprocessor system 100 must be mapped to a bitin the sharer-information field 188. The node to bit assignment table189 of FIG. 4 illustrates a mapping of a plurality of nodes to a numberof bits in a preferred embodiment (preferred embodiments of theinvention do not actually utilize a table, which is included here merelyfor illustration). Specifically, table 189 shows 76 nodes 102, 104mapped to respective bits in a 40-bit sharer-information field 188. Eachcolumn in table 189 is associated with a bit in the sharer-informationfield 188. Thus, according to table 189 the first bit in thesharer-information field 188 is associated with the node 102, 104identified (and addressed) as 40. Since only 76 nodes 102, 104 areincluded in the multiprocessor system 100 of this example, table 189includes only two rows. But if the number of nodes 102, 104 included inthe multiprocessor system 100 in this example exceeded 79, 119, 159,etc., additional rows would be included in the table 189. In otherwords, additional nodes 102, 104 would be associated with one or more ofthe bits in the sharer-information field 188.

As indicated above, the numbers included in each entry of table 189 arenode identifiers. The brackets around “0” is meant to indicate that 0 isnot a valid node identifier in the embodiment illustrated in table 189.In this embodiment, zero is used in the limited-pointer format toindicate that a particular sub-field of the sharer-information field 188does not identify a node 102, 104. To maintain consistency between thetwo formats, zero is not a valid node identifier in either format.

Determining the node identifiers for nodes 102, 104 associated with agiven bit in sharer-information field 188 (which permits the home node102, 104 to send out invalidation requests when a givensharer-information field 188 is in the coarse-vector format), is dividedinto two basic steps. Assuming that a given bit is set and associatedwith column 3 of table 189 (FIG. 4), the first node 102, 104 associatedwith this bit is simply the column number, i.e., 3. To calculatesubsequent node identifiers of nodes 102, 104 associated with this bit,the system adds to the column number positive integer multiples of thenumber of bits included in the sharer-information field 188 to thecolumn number. For example, for column three of the sharer-informationfield, the associated system nodes are 3, 43, 83 and so on. The secondstep (i.e., adding multiples of the number of bits in thesharer-information field 188) is continued until the calculated nodeidentifier exceeds the total number of nodes 102, 104 in multiprocessorsystem 100, in which case, the previously calculated node identifier isthe identifier of the final node 102, 104 associated with a given bit.

As noted above, each directory entry 182 includes a state field 186. Ina preferred embodiment, the state field 186 is set to one of thefollowing defined states:

invalid: indicates that the corresponding memory line 184 is not sharedby another node 102, 104;

exclusive: indicates that a node 102, 104 has an exclusive copy of thecorresponding memory line of information 184, and thus may make changesto the memory line of information 184;

shared: indicates that the sharer-information field 188 is configured inthe limited-pointer format described above and that the number of nodeshaving a non-exclusive (i.e., shared) copy of the corresponding memoryline of information 184 is less than or equal to DP;

shared-cv: indicates that more than DP nodes 102, 104 have anon-exclusive (i.e., shared) copy of the corresponding memory line ofinformation 184 and that the sharer-information field 188 is configuredin the coarse vector format described above.

Protocol Engines

The basic architecture of each of the protocol engines 122, 124 (FIG. 1)is shown in FIG. 5. The protocol engines are responsible for handlingmemory transactions, such as the sharing of cache lines, the exclusiveassignment of a cache line to a processor in a particular node of thesystem, remote read and write operations. The protocol engines 122, 124are responsible for maintaining cache coherence of cache lines among thenodes 102, 104 of the multiprocessor system 100.

Each of the protocol engines 122, 124, as shown in FIG. 5, includes aninput controller 190, preferably implemented as a finite state machineused in connection with a set of input buffers 192 for receiving data(inbound messages) from the ICS 112 and the PS 132. Received messages,some of which include a full cache line of data and the associatedparity bits, are stored in the input buffers 192. In a preferredembodiment, sufficient input buffers 192 are provided to store inbound,received data for up to sixteen ongoing memory transactions. A test andexecution unit 194 (herein called the execution unit) executesinstructions obtained from an instruction memory 196, also called themicrocode array, so as to advance memory transactions, also called cachecoherence transactions. The currently selected instruction, obtainedfrom the instruction memory 196, is held in a current instruction buffer197 for decoding and execution by the execution unit 194. Outputmessages generated by the execution unit 194 are stored in a outputbuffers 198, the operation of which are controlled by an outputcontroller 200, preferably implemented as a finite state machine. Theoutput messages are transferred from the output buffers 198 to specifieddestinations within the same node 102, 104 as a protocol engine 122, 124via the ICS 112 or to specified destinations within other nodes 102, 104of the multiprocessor system 100 via the PS 132.

While the processor nodes 102 and I/O nodes 104 of a preferredembodiment use two protocol engines, including a home protocol engine(HPE) 122 (FIG. 1) for handling memory transactions where the node 102,104 in which the protocol engine 122 resides is the home of the memoryline that is the subject of the memory transaction, and a remoteprotocol engine (RPE) (124, FIG. 1) for handling memory transactionswhere a remote node 102, 104 is the home of the memory line that is thesubject of the memory transaction, for most purposes the two protocolengines 122, 124 may be considered to be logically a single protocolengine.

FIG. 6A shows the format of each of the instructions stored in theinstruction memory 196 and instruction buffer 197. As shown, eachinstruction includes an operator, two operands, and a next programcounter field. The operator indicates the type of operation to beperformed by the execution unit 194 when executing the instruction, thetwo operands provide parameters that affect the execution of aninstruction.

The current state of multiple memory transactions is stored in a set ofregisters collectively called the Transient State Register File (TSRF)202. Each memory transaction has a memory line address (sometimes calledthe global memory address) that identifies the memory line that is thesubject of the memory transaction. More specifically, the memory lineaddress identifies the node 102, 104 that interfaces with the memorysubsystem 123 that stores the memory line of information 184 (i.e., homenode) and a specific position within the memory subsystem 123 of thememory line of information 184. In a preferred embodiment, the top M(e.g., 10) bits of the memory line address identify the home node 102,104 of the memory line of information 184, while the remainder of theaddress bits identify the memory line 184 within the identified node. Ina preferred embodiment, the memory line address for a memory line doesnot include any of the address bits used to identify sub-portions of thememory line, such as individual 64-bit words of individual bytes withinthe memory line of information 184. However, in other embodiments thatsupport transactions on sub-portions of memory lines, the memory lineaddresses used may include bits for identifying such memory linesub-portions.

Referring to FIG. 6B, each memory transaction has a respective entry 210stored in the Transient State Register File (TSRF) 202 that indicatesthe state of the memory transaction. In a preferred embodiment, the TSRF202 has registers for storing sixteen entries 210 as well as accesscircuitry for reading and updating the contents of the TSRF entries 210.Obviously the number of entries in the TSRF 202 is a design choice thatwill vary from one implementation to another. Typically, the TSRF 202will include at least as many entries as the number of PCs 106 includedin a processor node 102.

Referring to FIG. 6B, the entries 210 of the TSRF 202 are divided intotwo groups—“even” TSRF entries 210 and “odd” TSRF entries 210. The“even” TSRF entries 210 are used for memory transactions associated withmemory lines of information 184 that have “even” memory line addresses(i.e., memory line addresses ending in a “0” bit), while the “odd” TSRFentries 210 are used for memory transactions associated with memorylines of information 184 that have “odd” memory line addresses (i.e.,memory line addresses ending in a “1” bit).

Referring to FIGS. 6B, 7A-7C, and 8, the sequence of operations requiredto execute an instruction so as to advance a memory transaction is:reading the TSRF entries, scheduling one of the transactions representedby the TSRF entries, retrieving from the instruction memory theinstruction identified by the TSRF of the scheduled transaction, andexecuting the instruction. As shown in FIGS. 7A and 7B, this sequence offour operations is pipelined and is furthermore performed by two“logical pipelines” that are parallel but offset from each other by oneclock cycle. One logical pipeline is for the odd TSRF entries and theother is for the even TSRF entries. However, the two logical pipelinesare implemented using a shared scheduler 212, a shared microcode array196 and access circuitry (see FIG. 8), and shared execute logic 240,which along with the scheduler 212 is part of the test and executionunit 194. Only the TSRF registers and access circuitry 202 have distincteven and odd circuits.

Alternating clock cycles of the test and execution unit 194 are calledEven and Odd clock cycles. As shown in FIG. 7A, during each even clockcycle the following operations are performed, simultaneously, by thecircuitry modules identified in FIG. 7B:

reading the Odd TSRF entries, including comparing the address in each ofthe Odd TSRF entries with the addresses of messages received from thepacket switch and intra-chip switch;

scheduling a next Even transaction (by selecting an Even TSRF entry) tobe advanced by executing an instruction identified by the “next PC”field of one of the Even TSRF entries;

reading the microcode instruction identified by (A) the Odd transactionscheduled in the immediately previous Odd clock cycle and the conditioncode (CC) bits stored in the TSRF entry for the scheduled Oddtransaction; and

executing the instruction for the currently scheduled Even transaction,where the instruction is identified by the “next PC” field of the Eventransaction selected by the scheduler two clock cycles ago as well asthe condition code bits stored in the TSRF of the currently scheduledtransaction.

Similarly, as shown in FIG. 7A, during each Odd clock cycle thefollowing operations are performed, simultaneously, by the circuitrymodules identified in FIG. 7B:

reading the Even TSRF entries, including comparing the address in eachof the Even TSRF entries with the addresses of messages received fromthe packet switch and intra-chip switch;

scheduling a next Odd transaction (by selecting an Odd TSRF entry) to beadvanced by executing an instruction identified by the “next PC” fieldof one of the Odd TSRF entries;

reading the microcode instruction identified by (A) the Even transactionscheduled in the immediately previous Even clock cycle and the conditioncode (CC) bits stored in the TSRF entry for the scheduled Eventransaction; and

executing the instruction for the currently scheduled Odd transaction,where the instruction is identified by the “next PC” field of the Oddtransaction selected by the scheduler two clock cycles ago as well asthe condition code bits stored in the TSRF of the currently scheduledtransaction.

The scheduler 212 selects the next Even (or Odd) transaction at the sametime that the current Even (or Odd) transaction is being executed. Insome circumstances, it is important for the current transaction toremain active and to be executed during two or more successive evenclock cycles. For example, this is the case when a transaction needs tosend two or more messages to other nodes in the system. The scheduler isable to determine whether the current Even (or Odd) transaction shouldbe scheduled to execute again during the next Even (or Odd) clock cycleby inspecting the state, counters and condition codes in the TSRF of thecurrently executing transaction to determine if they satisfy predefinedcriteria for continuing execution of the current transaction for anadditional execution cycle.

By interleaving instruction fetch and instruction execute cycles, thebandwidth and computational resources of the test and execution unit 194and the microcode memory 196 are fully utilized.

As shown in FIG. 6B, the test and execution unit 194 (FIG. 5) of theprotocol engine includes a scheduler 212 that selects an even TSRF entry210 and an odd TSRF entry 210, corresponding to the next even memorytransaction and the next odd memory transaction to be processed oradvanced by the execution unit 194. The selections by the scheduler 212are conveyed to a pair of multiplexers 214, 215 that transferinformation from selected even and odd TSRF entries 210 to a pair oflatches 216, 217 for storing the state of the currently running memorytransactions. The TSRF entries stored in latches 216, 217 are used bythe execution logic 242 (FIG. 8) of the execute unit 194 (FIG. 5).

Referring to FIG. 6C, each TSRF entry 210 includes many fields, a smallsubset of which are identified and described below:

a state field 220: indicates the state of the associated memorytransaction if any;

an address field 222: stores the memory line address associated with amemory transaction if any;

a next program counter field 224: identifies the next instruction to beexecuted by the execution unit when certain preconditions required forcontinued execution of the memory transaction are satisfied; and

a set of counter fields 226: are used to store count values that, forexample, control repeated execution of an instruction (e.g., when atransaction needs to send out N identical protocol messages to othernodes 102, 104, one of the counter fields 226 is initially to a valuecorresponding to N, and is then decremented or incremented after eachexecution of the instruction until a predefined terminal count value isreached, at which point the memory transaction is either complete or anext program counter for the transaction is determined). The counterfields 226 and the state field 220 together form an overall or morespecific state of an associated memory transaction.

In a preferred embodiment, the set of defined states for the state field220 include:

vacant (also called invalid): indicates that the TSRF entry 210 does notstore information related to a memory transaction;

active: indicates that the associated memory transaction is availablefor scheduling/execution;

running: indicates that the associated memory transaction is currentlyrunning (i.e., is currently being executed by the execution unit 194, orwas the transaction for which an instruction was executed during thelast available even or odd execution cycle);

waiting: indicates that the associated memory transaction isstalled/deferred, waiting for a protocol message from another node 102,104 to be delivered via the PS 132;

local_waiting: indicates that the associated memory transaction isstalled, waiting for a protocol message from within the same node 102,104 to be delivered via the ICS 112; and

suspended: indicates that the associated memory transaction is suspendedbecause there is a memory address conflict with a previously allocatedmemory transaction having the same memory line address.

FIG. 7C shows all defined state transitions for each of the TSRF entries210. A Vacant TSRF entry 210 becomes Active when a message initiating anew memory transaction is received and there is no unfinishedtransaction having the same memory line address and that blocksactivation of the new memory transaction. A Vacant TSRF entry 210becomes Suspended when a message initiating a new memory transaction isreceived and there is unfinished memory transaction having the samememory line address that blocks activation of the new memorytransaction.

When an Active transaction is scheduled for execution it enters theRunning state. If the execution of the transaction completes thetransaction, the TSRF returns to the Vacant state. The RunningTransaction remains in the Running state until it was sent all theprotocol messages required for handling a current portion of thetransaction. If execution of the transaction does not complete thetransaction, the state of the TSRF becomes Waiting if the transaction iswaiting for one or more messages from one or more other nodes to be ableto continue the transaction, and becomes Local_Waiting if thetransaction is waiting only for one or more messages from the local nodeto be able to continue the transaction.

The scheduler 212 includes arbitration logic for selecting the next evenTSRF entry and the next odd TSRF entry to be sent to the execution unit194 in accordance with (A) the states of the TSRF entries, (B) thebuffered received messages received via the PS 132 and the ICS 112 andwhich TSRF entry, if any, corresponds to each of the buffered receivedmessages, and (C) a set of prioritization rules. Each TSRF entry andeach buffered received message identifies the memory line associatedtherewith, and the arbitration logic of the scheduler includes an arrayof comparators for comparing the memory line addresses in the TSRFentries with the memory line addresses in the buffered received messagesso as to produce a corresponding set of status update signals. Thestatus update signals are used for “upgrading” TSRF entries from theWaiting and Local_Waiting state to the active state, as well as fordowngrading the TSRF entry for the last running transaction to thewaiting, local waiting or vacant state, depending on whether thetransaction is finished, and if not finished, what type of message(i.e., from the local node or a remote note) the transaction needs toreceive in order to ready to resume execution.

The status update signals are also used to determine when a bufferedreceived message has the same address as a previously allocated TSRF,but is for a different memory transaction. When this condition isdetected by the arbitration logic, one of three actions is performed:(A) a new TSRF entry is allocated for the transaction associated withthe received message, and the new transaction is suspended, (B) thereceived message is merged into previously allocated transaction andmodifies its state, or (C) the message is temporarily left in the inputbuffer because the previously allocated transaction is not currently ina state allowing the received message to be merged with it, and thereceived message is then either merged with the previously allocatedtransaction or, if that transaction completes, a new TSRF is allocatedfor the new message and that TSRF is placed in the Active state. Whenthe received message is of the type that could potentially be mergedwith a previously allocated transaction, the previously allocatedtransaction must be in the Waiting or Local_Waiting state before themerger can be performed. When a Receive instruction is executed, thetransaction enters a Waiting or Local_Waiting state. The transaction cannot enter the Active state until either (A) one of the predefinedmessages required to advance the transaction, or (B) one of thepredefined messages that can be merged with the transaction is received.

Referring to FIGS. 6B and 8, the scheduler 212 selects between continuedexecution of the currently Running transaction and any of the otherActive transactions, if any. FIG. 6B shows a portion of the logic forselecting an Active transaction. FIG. 8 shows logic for continuingexecution of a currently Running transaction. On the right side of FIG.8 is shown a current instruction buffer 197 for holding the currentinstruction for Running transaction.

The operator and arguments of the current instruction are passed to theexecute logic 242, which also has access to all the fields of the TSRFof the Running transaction. The execute logic computes a set ofcondition codes, labeled “Curr_CC” in FIG. 8, as well as new State andNext PC for the TSRF of the running transaction. The Next PC, to bestored in the TSRF of the current Running transaction, is obtained fromthe current instruction stored in buffer 197. The execute logic 242 mayalso update one or more counters in the TSRF of the current Runningtransaction as well as other fields of the TSRF.

When the scheduler 212 determines that the current Running transactionshould continue to run, the next instruction for the transaction isdetermined as follows. The current instruction in buffer 197 includes a“Next PC” field that specifies the base address of a next instruction.Predefined bits (e.g., the four least significant bits) of the “Next PC”address are logically combined (by logic gate or gates 244) with thecondition codes (Curr_CC) generated by the execute logic 242 so as togenerate a microcode address that is stored in microcode address latch246. Multiplexers 248 and 250 are provided to facilitate selectionbetween the current Running transaction and another Active transaction.Multiplexers 248 and 250 operate during both Even and Odd clock cyclesso as to perform separate instruction retrieval operations during Evenand Odd clock cycles (See FIG. 7A).

When all the Even (or Odd) TSRF entries are in the Vacant state, meaningthat there are no running, active or waiting Even (or Odd) memorytransactions, there are no Even (or Odd) memory transactions for thescheduler to select for execution, and thus the corresponding logicalpipeline is unused. More generally, when none of the Even (or Odd) TSRFentries are in the Running or Active state (see discussion of FIG. 6C),meaning that there are no Even (or Odd) memory transactions that areready to be processed by the execution unit of the protocol engine, thecorresponding logical pipeline is unused. During the corresponding clockperiods instructions are not fetched from the instruction memory and thetest and execution unit remains dormant.

The operation of the protocol engine while handling various specificmemory transactions will be described in more detail below. Additionalaspects of the scheduler and execution logic will also be described inmore detail below.

L1 Cache

Referring to FIG. 9A, for simplicity a direct mapped version of the L1cache 260 will be explained before explaining the two-way setassociative version, shown in FIG. 9B. Each L1 cache 260, whether it isa data or instruction cache (see FIG. 1) includes a data array 262 forstoring cache lines, a tag array 264 and a state array 266. Each entry268 of the L1 cache 260 includes a cache line, a tag and a state value.The cache line consists of the data from one memory line, and in apreferred embodiment this consists of 64 bytes (512 bits) of data plusparity and ECC bits corresponding to the 64 bytes.

The tag of each entry 268 consists of the address bits required touniquely identify the cache line, if any, stored in the entry. Eachaddress used to access memory consists of a string of address bits,ABCD, where A, B, C and D each consist of different groups of theaddress bits. The D bits are used to identify specific words (or bits,or bytes, depending on the implementation) within the cache line. The Band C bits, herein called BC, identify the entry 268 into which thememory line at address ABCO is stored within the L1 cache. The BC bitsare called the index or cache index of the address. The A bits comprisethe tag of the cache line, which together with the cache index uniquelyidentify the memory line. The only reason for dividing the cache indexbits, BC, into two groups is for purposes of explaining the embodimentshown in FIG. 9B.

The state of each L1 cache entry 268 is represented by two bits, whichfor each cache line represent one of four predefined states:

invalid, which means that the cache entry 268 is empty, or that the datain it is invalid and should not be used;

shared, which means that other processors or other nodes in the systemhave non-exclusive copies of the same memory line as the one stored inthe cache entry;

clean_exclusive, which means that this L1 cache has the only copy of theassociated memory line, has been allocated exclusive use thereof, andthat the value of the cache line has not been changed by the processorcoupled to the L1 cache; and

dirty_exclusive, which means that this L1 cache has the only copy of theassociated memory line, has been allocated exclusive use thereof, andthat the value of the cache line has changed by the processor coupled tothe L1 cache.

Referring to FIG. 9B, there is shown a two-way associative version ofthe L1 cache, which is a preferred implementation. Only the differencesbetween the L1 caches of FIGS. 9B and 9A will be described. Inparticular, the set associative L1 cache 270 has the same number ofentries 278 as the direct mapped L1 cache 260, but in this version thereare two cache lines mapped to each cache index instead of just one. As aresult, there are only half as many cache index values, and thereforethe cache index is represented by just the C bits of the ABCD addressbits. In this embodiment of the L1 cache, the B address bit of eachmemory line address is included in the tag of the entry, and thus thetag array 274 is one bit wider in this embodiment than in the directmapped L1 cache embodiment. If the L1 cache were a four-way associativecache, the tag array 274 would be two bits wider than in the directmapped L1 cache embodiment. A two-way associative L1 cache is preferredover a direct mapped cache because it reduces cache evictions caused bycache index conflicts.

L1 Data Paths and Control Logic

FIG. 9C shows the data paths and primary components of the L1 cache 108,110. Some of the connections between the various finite state machinesof the L1 cache and some of the connections between those finite statemachines, the tag and state arrays 274, 266 and other components of theL1 cache 108, 110 that are described below are not shown in FIG. 9C inorder to avoid undue cluttering of this figure.

The L1 cache receives data (PC_L1_data) and a virtual address (PC_vaddr)from the processor core coupled to the L1 cache. Other signals receivedby the L1 cache from the processor core are a read request signal(PC_RdRq), which signals that the processor core is requesting data fromthe L1 cache, and a write request (PC_WrRq), which signals that theprocessor is requesting to write data into the L1 cache. The signalssent by the L1 cache to the processor core include data output by the L1cache (L1_PC_data), a replay signal (PC_replay) requiring the processorto retry the last request sent by the processor core to the L1 cache,and an inhibit signal (PC_inhibit) to inform the processor core toinhibit its memory accesses because the L1 cache is busy (e.g.,servicing a cache miss).

The L1 cache receives data from and sends data to the L2 cache, mainmemory, and other devices via the intra-chip switch 112. Received datais temporarily buffered by a data in buffer 310, and data being sentelsewhere is output via an output finite state machine (Output FSM) 312.The output buffer for sourcing data to the ICS 112 is called the Fwd/Evtbuffer 366.

Input logic 314 receives control signals sent via the ICS 112 andconveys those control signals to either a fill FSM 316 or a synonym FSM318. The fill FSM 316 controls the loading of a cache line received fromthe ICS 112 into the L1 cache data array 262. The synonym FSM 318controls the movement of a cache line from one L1 cache slot to anotherwhen the L2 cache instructs the L1 cache to do so. Multiplexer 320routes cached data from a slot of the L1 cache data array 262 back tothe data array input multiplexer 322 under the control of the synonymFSM 318. Input and output staging buffers 321, 323 are preferably usedin this data path, for instance to facilitate delivery of successiveportions of the data in a cache line over the data path.

When the synonym FSM 318 is not active, multiplexer 320 sources datafrom the data input buffer 310 to the data array input multiplexer 322.The movement of a cache line from one L1 cache slot to another isrequired when the cache line index derived from a virtual address doesnot match the physical location of a cache line in the L1 cache. A taginformation input multiplexer 324 is also controlled by the synonym FSM318 to enable tag information for the L1 tag array 274 to be sourced bysynonym information from the synonym FSM 318 when the synonym FSM 318 isactivated. When the synonym FSM 318 is not activated, the taginformation input multiplexer 324 sources tag information for the L1 tagarray 274 from the virtual address (PC_vaddr) provided by the processorcore.

An inhibit FSM 330 receives signals from the fill FSM 316 and synonymFSM 318 when those finite state machines are activated and sources thePC_inhibit signal to the processor core while either of these finitestate machines is servicing a cache fill or synonym cache linerelocation operation.

When the processor core sends either a read or write request to the L1cache, the processor core provides a virtual address, PC_vaddr. Thevirtual address and information derived from it, such as a valid tagmatch signal, are stored in a series of staging buffers 332, 334, 336.Additional staging buffers, beyond those shown in FIG. 9C, may berequired in some implementations. The virtual address is translated intoa physical address (PA) by a translation lookaside buffer (TLB) 340 atthe same time that a tag and state lookup is performed by the tag andstate arrays 274, 266. The resulting physical address and tag lookupresults are stored in a second staging buffer 334 and are then conveyedto a tag checking circuit 342 that determines if there is a tag matchfor a valid cache line. The results of the tag check, which includesstate information as well as tag match information and the virtualaddress being checked, are stored in yet another staging buffer 336. Theinformation in the staging buffer 336 is conveyed to a data write FSM360 when a valid match is found, and is conveyed to the output FSM 312when a cache miss is detected. The final staging buffer 336 also storesa “replay” signal, generated by the tag checking circuit 342, and thereplay signal is conveyed to the processor core to indicate whether theL1 read or write operation requested by the processor core must beresubmitted to the L1 cache after the PC_inhibit signal is deactivated.

When a data write is being performed, the write request signal (PC_WrRq)and the results of the tag lookup are used by a data write FSM 360 and acache access Arbiter 362 to determine if (and when) the data sourced bythe processor core is to be written into the L1 cache data array 262.The data sourced by the processor core is buffered in a series ofstaging buffers 352, 354, 356 so that the data to be written isavailable at the data array input multiplexer 322 at the same time thatthe tag check results become available to the data write FSM 360. Thedata write FSM 360 stalls the data pipeline 352, 354, 356 if the arbiter362 determines that the L1 cache is not ready to store the sourced datainto the L1 cache data array 262.

When a data read is being performed, the read request signal (PC_RdRq)is received directly by the arbiter 362 and the virtual address is usedto directly read a cache line in the data array 262 even before theresults of the tag lookup and check are ready. The data read from thedata array is temporarily buffered in staging buffer 321 and isdiscarded if a cache miss is detected. If the read data is being read inresponse to a processor core request and a cache hit is detected, theread data is sourced from the staging buffer 321 to the processor corevia the data path labeled Array_Out Data (L1_PC_data). If the read datais being read in response to a request received via the ICS 112, theread data is sourced from the staging buffer 321 to the Fwd/Evt buffer366, and from there it is conveyed to the output FSM 312 fortransmission to the requesting device via the ICS 112.

L2 Cache with Duplicate L1 Tags

Referring to FIG. 10A, the L2 cache includes a set of “duplicate L1 tagand state arrays” 280. These “DTag” arrays 280 contain exact copies ofthe tag arrays of all the L1 caches in the same node as the L2 cache,and furthermore contain state information that is similar to, but notidentical, to the state information in the L1 cache state arrays 266(FIG. 9A). Thus, each entry 288 of the DTag arrays 280 corresponds toexactly one of the L1 cache entries 268 in the L1 caches of the node.The relationship between the state information in the L1 cache, thestate information in the DTag arrays 280 of the L2 cache, and the stateinformation in the L2 cache (see FIG. 10B) is as follows:

Possible corresponding L1 state DTag-L1 state L2 states invalid invalidinvalid, clean, clean_nodex, dirty shared shared_clean invalid, clean,clean_nodex, dirty shared_clean_owner invalid shared_clean_owner_nodexinvalid shared_dirty invalid clean_exclusive exclusive invaliddirty_exclusive invalid

As shown in the above table, the L2 cache keeps additional informationin the DTag arrays regarding the ownership of shared cache lines. Forinstance, the shared_clean_owner_nodex state for any particular cacheline indicates that the cache line in the L1 cache has not beenmodified, and that this node is the exclusive owner of the cache line.The clean_nodex state in the L2 cache means the same thing.

An L1 cache line with a DTag state of exclusive, shared_dirty,shared_clean_owner or shared_clean_owner_nodex is the owner of the cacheline. If the L2 cache has a valid copy of the cache line, it is theowner of the cache line, and the only possible DTag states for thatcache line are invalid or shared_clean. An L1 cache always performs awrite-back when it replaces a cache line of which it is the owner. Thewritten back cache line is loaded into the L2 cache, possiblyvictimizing another L2 cache line.

The L1 cache owner of a cache line responds to other L1 misses on thesame cache line. In this case the requester of the cache line become thenew owner and the previous owner's DTag state for the cache line ischanged to shared_clean.

If a cache line is present in a particular node, node-exclusiveinformation is kept in either the L2 state of in the DTag state of theowner L1 cache. The L2 states clean_nodex and dirty, and the DTag statesshared_clean_owner_nodex, shared dirty and exclusive all indicate thatthe node is the only node in the system that is caching the identifiedmemory line (i.e., identified by the tag and cache index of the cacheline). In a preferred embodiment, dirty (i.e., modified) cache lines arenever shared across nodes. Thus, if a node has cache line that has beenmodified with respect to the memory copy, no other node in the systemcan have a copy of the line. As a result, when a node requests a sharedcopy of a cache line that has been modified by another node, the memorytransaction that satisfies the request will always write-back themodified data to memory. Within a single node, however, a preferredembodiment allows sharing of a modified cache line among the processorcores. In this case, the DTag state of the L1 owner is set toshared_dirty and any other sharers have their DTag state set toshared_clean.

Referring to FIG. 10B, the main L2 cache array 290 includes a data array292 for storing cache lines, a tag array 294 and a state array 296. TheL2 cache array is preferably distributed across eight interleavedarrays, but for purposes of this explanation, the interleaved arraystructure is not shown, as it does not affect the logical organizationand operation of the L2 cache. Each entry 298 of the L2 cache 260includes a cache line, a tag and a state value. The cache line consistsof the data from one memory line, and in a preferred embodiment thisconsists of 64 bytes (512 bits) of data plus parity and ECC bitscorresponding to the 64 bytes.

The tag of each entry 268 consists of the address bits required touniquely identify the cache line, if any, stored in the entry. Becausethe L2 cache is typically much larger than the L1 caches, a differentsubset of the address bits of a memory line address is used to identifythe cache index and a different subset of the address bits is used asthe tag compared with the address bits used for those purposes in the L1caches.

The L2 cache line state value for each L2 cache entry is selected fromamong the following state values:

invalid, which means that the cache entry 268 is empty, or that the datain it is invalid and should not be used;

clean, which means that the value of the memory line has not beenchanged and is therefore the same as the copy in main memory, andfurthermore means that copies of the cache line may be stored in (A) oneor more of the L1 caches of the same node as the L2 cache and/or (B) theL1 or L2 caches in other nodes of the system, and that these copies arenon-exclusive copies of the same memory line as the one stored in the L2cache entry;

clean_nodex (clean node-exclusive), which means that the L2 cache has aclean copy of the associated memory line (i.e., the memory line has notbeen changed and is the same as the copy in main memory), and that theremay be cached copies of this memory line in local L1 caches in the samenode as the L2 cache, but there are no copies of the memory line in anyother nodes of the system; and

dirty, which means that this L2 cache has the only copy of theassociated memory line, and that the value of the cache line has beenchanged by one of the processor cores coupled to the L2 cache.

L2 Data Paths and Control Logic

FIG. 10C shows the data paths and primary components of the L2 cache116. As described earlier with respect to FIG. 3, the L2 cache has aninterface to the intra-chip switch 112. This interface includes one ormore input buffers 160, one or more output buffers 162, an input finitestate machine (In FSM) 164 for controlling use of the input buffer(s)160, and an output finite state machine (Out FSM) 166 for controllinguse of the output buffer(s) 162. Similarly, the L2 cache 116 has aninterface to the memory controller 118 (see also FIG. 1) that includesone or more input buffers 400, one or more output buffers 402 and amemory controller interface finite state machine (MC interface FSM) 404for controlling the use of the MC interface input and output buffers400, 402.

A set of pending buffers 406 are used to store status information aboutmemory transactions pending in the L2 cache. For instance, the pendingbuffers 406 keep track of requests made to the memory subsystem (seeFIG. 1) via the memory controller 118. A set of temporary data buffers408 are used to temporarily store cache line data associated withpending memory transactions, including data being sourced to the L2cache, data sourced from the L2 cache, and data transported through theL2 cache (i.e., from the memory subsystem 123 to the L1 cache). Datasent by the L2 cache in response to an L1 cache miss bypasses thetemporary data buffers 408 and is sent via a bypass data path 410 so asto reduce latency when the L2 cache contains the data needed to satisfya cache miss in an L1 cache (which is coupled to the L2 cache via theICS 112).

The duplicate tag (DTag) arrays 280 and L2 tag and state arrays 294, 296have been discussed above with reference to FIGS. 10A and 10B. Access toand updating of these arrays is handled by the main L2 finite statemachine 412. The main L2 FSM 412 includes DTag and tag lookup, DTag andtag checking, and DTag, tag and state updating logic.

When an L1 cache miss is serviced by the L2 cache 116, and the L2 cachedoes not have a cached copy of the memory line required by the L1 cache,the request is forwarded to the memory subsystem 123 via the MCinterface FSM 404. The memory line of information provided by the replyfrom the memory subsystem 123 is not stored in the L2 cache 116. Insteadthe memory line is sent directly to the L1 cache, bypassing the L2 dataarray 292. More specifically, the reply from the memory subsystem isdirected through multiplexer 414 to the Din2 input port of the temporarydata buffers 408. The reply is then output at the Dout1 port of thetemporary data buffers 408 to the interface output buffer 162 via outputmultiplexer 416.

When an L1 cache evicts a memory line from the L1 cache, the victimmemory line is sent to the L2 cache for storage via the ICS 112 and theinterface input buffer 160. The victim memory line is received at theDin1 input port of the temporary data buffers 408 and temporarily storedtherein. The victim memory line is then sent from the temporary databuffers 408 to the L2 data array 292, via the Dout2 port of thetemporary data buffers 408 and a staging buffer 418, for storage in theL2 data array 292.

When the L2 cache sources a memory line to an L1 cache, the memory lineread from the L2 data array 292 is conveyed via bypass line 410 tooutput multiplexer 416, and from there to the ICS interface outputbuffer 162. The output FSM 166 handles the transfer of the memory linefrom the output buffer 162 to the ICS 112, and from there it is sent tothe L1 cache.

Duplicate tags (DTags) are used by the L2 cache to determine which L1caches have cached copies of an identified memory line. The duplicatetags in the DTag arrays 280 are accessed by the main L2 FSM 412, andinformation derived from the duplicate tags is used to send messages viathe output FSM 166 to one or more of the L1 caches in the same node asthe L2 cache, or to other components of the node.

Cache Coherence Protocol

The present invention includes a cache coherence protocol (CCP) thatenables the sharing of memory lines of information 184 across multiplenodes 102, 104 without imposing protocol message ordering requirementsor requiring negative acknowledgments (NAKs). Because invalidation NAKsare not used in this invention, the CCP includes an assumption that thevarious requests (e.g., read request) discussed below always succeed.Additionally, the CCP is invalidation based, so shared copies of amemory line of information 184 are invalidated when the memory line ofinformation 184 is updated.

As noted above, memory transaction relates to a memory line ofinformation. Completion of a memory transaction requires a plurality ofprotocol messages, which are generated in part by instructions.Preferred embodiments of the present invention use seven instructiontypes: SEND, RECEIVE, LSEND (to local node), LSEND_REC (combinedsend/receive to/from local node), TEST, SET, and MOVE. The actualprotocol code is specified at a slightly higher level with symbolicarguments, and C-style code blocks. A sophisticated microcode assembleris used to do the appropriate translation and mapping to instructionmemory 196.

Typical memory transactions require only a few instructions at each node102, 104 for completion. For example, a memory transaction including aread request of a memory line of information 184 stored in a memorysubsystem interfaced with a remote node 102, 104 requires a total offour instructions at the requesting node 102, 104: a SEND of the readrequest to the remote node 102, 104; a RECEIVE of the read reply; a TESTof the state of the memory transaction (e.g., state field 220 andcounters field 226); and an LSEND that sends a protocol message based onthe read reply to the PC 106 that initiated the memory transaction. TheCCP supports read, read-exclusive, exclusive, and write-back requesttypes. A number of other protocol messages are supported as well inorder to implement the requests.

The request types are now discussed in greater detail. FIG. 11Aillustrates steps executed to satisfy a read request for a memory lineof information 184. In a first step, a PC 106 issues the read requestfor the memory line of information 184 (step 1100). If the memory lineof information 184 is stored locally (step 1102-Yes), the state of thememory line of information 184 is checked by reference to acorresponding entry 182 in the directory 180 (step 1104). If thedirectory entry 182 does not indicate that a remote node 102, 104 has anexclusive copy of the memory line of information 184 (step 1106-No), thememory line of information 184 is retrieved directly from the memorysubsystem 123 (FIG. 11B, step 1108).

If the memory line of information 184 is not stored locally (step1102-No), the read request is routed to the RPE 124 (step 1110). The RPE124 adds an entry 210 in the TSRF 202 (step 1112). The new entry 210indicates that a read reply is required to advance the state of thismemory transaction. The new entry 210 also indicates that until the readreply is received, incoming requests related to the memory line ofinformation 184 are stalled, which means that a TSRF entry 210 is addedto the TSRF 202 for the incoming requests. Once the read reply isreceived, the state of the TSRF entry 210 is updated by the RPE 124 sothat these incoming requests are processed.

The RPE 124 then sends a read request to the home node (step 1114). Thehome node is the node 102, 104 to which the memory subsystem 123 storingthe memory line of information 184 is interfaced.

The read request is received by the home node 102, 104, and routedinternally as described above to the HPE 122 (step 1116). The HPE 122responds by adding an entry 210 in the TSRF 202 (step 1118) and checkingthe state of the memory line of information 184 in a corresponding entry182 in the directory 180 (step 1120). If the entry 182 does not indicatethat a node 102, 104 has an exclusive copy of the memory line ofinformation 184 (FIG. 11C, step 1122-No), the HPE 122 updates the entry210 in the TSRF 202 so that it indicates that the memory transactionrequires an internal response to a request for the memory line ofinformation 184 in order to advance to another state (step 1124). TheHPE 122 then submits an internal request for the memory line ofinformation 184 from the memory subsystem 123 (step 1126). Uponreceiving the memory line of information 184 (step 1128), the HPE 122sends a read reply to the requesting node 102, 104 (step 1130), updatesthe state of the memory line of information (step 1131), and removes theTSRF entry 210 (step 1132).

As noted above, the state of the memory line of information 184 isembodied in a corresponding entry 182 in the directory 180. Included inthe entry 182 is a state field 186 and a sharer-information field 188.If the state field 186 indicates that the state of the memory line ofinformation is shared-cv, the HPE determines which bit in the bits ofthe sharer-information field 188 the requesting node 102, 104 is mappedto. If the bit is not already set to indicate that a node 102, 104mapped to that bit is sharing a copy of the memory line of information184, the bit is so set.

If the state field 186 indicates that the state of the memory line ofinformation is “shared”, the HPE 122 determines if the requesting node102, 104 is already identified as sharing the memory line of information184 in the sharer-information field 188. If so, the sharer-informationfield 188 and state field 186 are not changed. If the requesting node102, 104 is not already identified as sharing the memory line ofinformation 184, the HPE 122 determines if any of the sub-fields withinthe sharer-information field 188 is set to indicate that it does notidentify a sharer node 102, 104 (e.g., set to zero). If such a field isfound, the HPE 122 sets it to identify the requesting node 102, 104. Asnoted above, the identity of the requesting node 102, 104 is included inthe original request to share the memory line of information 184. If nosuch sub-field within the sharer-information field 188 is set toindicate that it does not identify a sharer node 102, 104, the HPE 122must set the state field 186 to “shared-cv”. Additionally, the HPE 122must identify and set the bits in the 40-bit sharer-information fieldassociated with (A) the four nodes 102, 104 previously identified by thesharer-information field 188 and (B) the requesting node 102, 104. TheHPE 122 then removes the entry 210 from the TSRF 202 (step 1132).

If the entry 182 indicates that a node 102, 104 (i.e., owner node) hasan exclusive copy of the memory line of information 184 (step 1122-Yes),the HPE 122 updates the entry 210 in the TSRF 202 so that it indicatesthat the memory transaction requires a share write-back in order toadvance to another state (FIG. 11D, step 1134). The state also indicatesthat any requests related to the memory line of information 184 receivedwhile the HPE 122 is waiting for the share write-back should be deferred(i.e., stalled) until after receipt of the share write-back. This isaccomplished by adding a new entry 210 to the TSRF 202 for suchrequests, and setting the state of these new entries 210 to indicatethat the associated memory transaction is eligible for processing oncethe share write-back is received.

The HPE 122 then sends a read forward to the owner node 102, 104 (step1136). The read forward is received by the owner node 102, 104, androuted to the RPE 124 (step 1138). The RPE 124 responds by adding anentry 210 in the TSRF 202 indicating that the memory transactionrequires an internal response to a request for the memory line ofinformation 184 in order to advance to another state (step 1140). TheRPE 124 then sends an internal request for the memory line ofinformation 184 from L1 or L2 cache 110, 114 (step 1141). Upon receivingthe memory line of information 184 (step 1142), the RPE 124 sends ashare write-back to the home node 102, 104 (FIG. 11E, step 1144) and aread reply to the requesting node 102, 104 (step 1146), both of theseprotocol messages include an up-to-date copy of the memory line ofinformation 184. The RPE 124 also removes the entry 210 from the TSRF202 (step 1148).

Upon receiving the share write-back (step 1150), the HPE 122 updates acopy of the memory line of information 184 (either in the memorysubsystem 123 initially or a local cache initially and the memorysubsystem 123 subsequently) (step 1152). HPE 122 then updates the stateof the memory line of information 184 in the directory 180 to indicatethat both the requesting node 102, 104 and the former owner node 102,104 are both storing a shared copy of the memory line of information 184(step 1154). The HPE 122 also updates the state of any entries 210 inthe TSRF 202 for a request relating to the memory line of information184 and received while waiting for the share write-back to indicate thatthe associated memory transaction may be executed. The HPE 122 thenremoves the entry 210 in the TSRF 202 related to this memory transaction(step 1155).

Upon receiving the read response (whether sent by the home node 102, 104or an owner node 102, 104) (step 1156), the RPE 124 forwards the sharedcopy of the memory line of information 184 to the PC 106 that initiatedthe memory transaction (step 1158). The RPE also removes the entry 210in the TSRF 202 related to the memory transaction (step 1160).

The read request steps described above with reference to FIGS. 11A-11Eare subject to an optimization in preferred embodiments of the presentinvention. Specifically, if the memory line of information requested bythe requesting node 102, 104 is not shared or owned by any nodes 102,104, the HPE 122 returns an exclusive copy of the memory line ofinformation 184. In other words, the response to a request for a sharedcopy of the memory line of information 184 is “upgraded” from a readreply to a read-exclusive reply. Thus, the requesting node 102, 104 isidentified in the directory 180 as exclusive owner of the memory line ofinformation. However, this optimization does not affect the home node's102, 104 response to a request for a memory line of information that iscomprised of an instruction since an instruction is never written to bya requesting node. Thus, there is no reason to provide an exclusivecopy.

FIG. 12A illustrates steps executed to satisfy a request for anexclusive copy of a specified memory line of information 184, whichpermits the node 102, 104 requesting the memory line of information 184(i.e., requesting node) to modify the memory line of information 184. Ina first step, a PC 106 issues the request for an exclusive copy of thememory line of information 184 (step 1200). The request is routed to theRPE 124 (step 1210), which adds an entry 210 in the TSRF 202 (step1212). The new entry 210 indicates that a read-exclusive reply and anumber (zero or more) of invalidation acknowledgments are required toadvance the state of this memory transaction. The RPE 124 then sends aread-exclusive request to the home node (step 1214). At this point thememory transaction in the RPE 124 enters the Waiting state, where itremains until it receives the aforementioned read-exclusive reply and(zero or more) invalidation acknowledgments. When these messages arereceived by the RPE 124, the memory transaction it will made Active andthen Running in order to receive and process these protocol messages soas to advance and complete the memory transaction. The new entry 210also indicates that until the aforementioned replies are received,incoming requests related to the memory line of information 184 arestalled, which means that a TSRF entry 210 is added to the TSRF 202 forthe incoming requests. Once the aforementioned replies are received, thestate of the TSRF entry 210 is updated by the RPE 124 so that theseincoming requests are processed.

The read-exclusive request is received by the home node 102, 104, androuted to the HPE 122 (step 1216) of the home node, which adds an entry210 in the TSRF 202 (step 1218). The HPE 122 then checks the state ofthe specified memory line 184 in a corresponding entry 182 in thedirectory 180 (step 1220). At this time, the HPE also sends a request tothe L2 cache to locate and invalidate any copies of the specified memoryline that may be present on the home node. The L2 cache uses theinformation in its L2 tag array and DTag arrays to determine if anycopies of the specified memory line are present in the L2 cache or anyof the L1 caches in the home node. If a copy of the specified memoryline is found in the L2 cache, it is invalidated by the L2 cache, and ifa search of the DTag arrays locates any copies of the specified memoryline in the home node's L1 caches a command message is sent by the L2cache to the identified local L1 cache or caches instructing those L1caches to invalidate their copies of the specified memory line. Each L1cache that receives the invalidate command respond to this command bysetting the state of the corresponding cache line to “invalid.” Itshould be noted that when the requestor for exclusive ownership of thespecified memory line is a processor core in the home node of the memoryline, L2 cache invalidates all cached copies of the specified memoryline except for the copy (if any) held by the L1 cache of the requestingprocessor.

If the directory entry 182 for the specified memory line does notindicate that a node 102, 104 has an exclusive copy of the memory lineof information 184 (FIG. 12B, step 1222-No), the HPE 122 updates theentry 210 in the TSRF 202 to indicate that the memory transactionrequires an internal response to a request for the memory line ofinformation 184 in order to advance to another state (step 1224). TheHPE 122 then sends a request for the memory line of information 184 fromthe memory subsystem 123 (step 1226). Upon receiving the memory line ofinformation 184 (step 1228), the HPE 122 determines the number of nodes102, 104 that have a shared copy of the memory line of information byreference to an entry 182 in the directory 180 corresponding to thememory line of information 184 (step 1230). The HPE 122 then sends aread-exclusive reply to the requesting node 102, 104 (step 1232). Theread-exclusive reply includes a copy of the memory line of informationand indicates the number of invalidation acknowledgments to expect. HPE122 then sends an invalidation request to each node 102, 104, if any,that has a shared copy of the memory line of information 184 (step1233). The HPE uses the information in the directory entry for thememory line to identify the nodes having a shared copy of the memoryline. HPE 122 then updates the state of the memory line of information184 in the directory 180 to indicate that the requesting node 102, 104is an exclusive owner of the memory line of information (step 1234) andremoves the TSRF entry 210 in the TSRF 202 related to this memorytransaction (step 1235). Thus, from the perspective of the home node102, 104, the entire memory transaction (including activity at othernodes 102, 104) is now complete, though other nodes 102, 104 mustprocess protocol messages relating to this memory transaction.

The invalidation request is received by the sharer node(s) 102, 104, androuted to the RPE 124 (step 1236) in each of those nodes, which respondby adding an entry 210 to the TSRF 202 (step 1237). The RPE 124 respondsinitially by sending an invalidation acknowledgment to the requestingnode 102, 104 (step 1238). Additional steps taken by the RPE 124 dependupon whether the RPE is waiting on any requests related to the samememory line of information 184 (step 1239). See the discussion below, inthe section entitled “Limited Fanout Daisy-Chaining InvalidationRequests,” for a description of another methodology of sending andhandling invalidation requests and acknowledgments.

If the RPE 124 is waiting for a response to a read request, theinvalidation request is merged with the outstanding read requesttransaction. To do this the RPE updates the TSRF entry 210 correspondingto the outstanding read request to indicate that an invalidation requestrelated to the same memory line of information 184 has been received.Once the response to the read request is received, the PC 106 thatinitiated the read request/memory transaction is given a read-once copyof the memory line of information. In other words, the PC 106 is notpermitted to cache a copy of the memory line of information 184. Thissituation (receiving an invalidation request while waiting for aresponse to a read request) occurs because the CCP does not orderprotocol messages. More specifically, the home node 102, 104 receivedthe read request and sent a response to the read request beforereceiving the read-exclusive request and sending the invalidationrequest, but the invalidation request is received before the response.

If the RPE 124 is waiting for a response to a read-exclusive request oran exclusive request, the invalidation request is acknowledged as notedabove and no additional steps are taken (e.g., there is no limitation toa read-once copy).

Once these additional steps are complete, the RPE 124 removes the TSRFentry 210 related to this memory transaction (step 1240).

If the directory entry 182 indicates that a node 102, 104 has anexclusive copy of the memory line of information 184 (step 1222-Yes),the HPE 122 sends a “read-exclusive forward” message to the owner node102, 104 (step 1241), updates the state of the memory line ofinformation 184 in the directory 180 to indicate that the requestingnode 102, 104 is exclusive owner of the memory line of information 184(step 1242), and removes the TSRF entry 210 in the TSRF 202 related tothis memory transaction (step 1243). Thus, from the perspective of thehome node 102, 104, the entire memory transaction (which includesactivity at other nodes 102, 104) is now complete, though other nodes102, 104 continue to process this memory transaction.

The read-exclusive forward is received by the owner node 102, 104, androuted to the RPE 124 (step 1244). The RPE 124 responds by adding anentry 210 in the TSRF 202 indicating that the memory transactionrequires an internal response to a request for the memory line ofinformation 184 in order to advance to another state (step 1245). TheRPE 124 then sends a request for the memory line of information 184 fromthe L1 or L2 cache 110, 114 in which the memory line is locally stored(step 1246). Upon receiving the memory line of information 184 (step1247), the RPE 124 sends a read-exclusive reply to the requesting node102, 104 (step 1248). This protocol messages includes an up-to-date copyof the memory line of information 184. The RPE 124 then invalidates thelocal copy of the memory line of information 184 (step 1249) and removesthe entry 210 from the TSRF 202 (step 1250).

When the home node is the owner node, there is no need for the HPE ofthe owner node to send a read-exclusive forward to the owner node.Instead, the HPE sends a message to the L2 cache requesting that itforward a copy of the specified memory line and that it furthermoreinvalidate all cached copies of the memory line in the L2 cache and/orthe L1 caches in the home node. The HPE would then send theread-exclusive reply message to the requesting node (i.e., steps 1246through 1250 would be performed by the home node, since it is also theowner node in this example).

Upon receiving the read-exclusive response (step 1252), the steps takendepend upon the content of the response. As noted above, aread-exclusive request can result in a number of invalidationacknowledgments from nodes 102, 104 that have or had a shared copy ofthe memory line of information 184. Additionally, the CCP does notrequires protocol message ordering, so invalidation acknowledgments canarrive at the requesting node before a read-exclusive reply. If theresponse is an invalidation acknowledgment (step 1253-Yes), RPE 124updates the TSRF entry 210 in the TSRF 202 associated with this memorytransaction to reflect that the invalidation acknowledgment was received(step 1256). More specifically, RPE 124 increments or decrements acounter in the counter fields 226 of the TSRF entry 210.

If the response is not an invalidation acknowledgment (step 1253-No), itis a read-exclusive reply, in which case the RPE 124 forwards the memoryline of information 184 included in the reply to the PC 106 thatrequested the memory line of information (step 1254). If theread-exclusive reply indicates that a number of invalidationacknowledgment are to be received, the reply to the PC 106 alsoindicates that the memory transaction is not complete (unless the numberof invalidation acknowledgments have already been received). RPE 124then updates the TSRF entry 210 to reflect that the read-exclusive replyhas been received and to indicate the number of invalidationacknowledgments, if any, to be received as well (step 1256).

Whether an invalidation acknowledgment or a read-exclusive reply isreceived, RPE 124 then determines if another protocol message is due(e.g., an invalidation acknowledgment or a read-exclusive reply). If noadditional protocol messages are due, (step 1258-Yes), RPE 124 removesthe TSRF entry 210 from the TSRF 202 (step 1260). Otherwise, the entry210 is not removed immediately, but is updated and eventually removed asadditional, related protocol messages are received. Additionally, theRPE 124 sends an additional message to the PC 106 to indicate that thememory transaction is complete if the RPE 124 indicated to the PC 106 inits earlier reply that the memory transaction was not complete.

Until the TSRF entry 210 in the TSRF 202 is removed, incoming requests(read, read-exclusive, exclusive protocol messages) related to thememory line of information 184 are merged with the existing TSRF entry210 related to this memory line of information 184 and put in theSuspended state. Once the read-exclusive reply and all invalidationacknowledgments, if any, are received, the state of the TSRF entry 210is updated to the Active state so that it will be selected by thescheduler and the merged requests will be processed by the test andexecution unit 194.

Additionally, the write request steps described above with reference toFIGS. 12A-12D are subject to an optimization in preferred embodiments ofthe present invention. Specifically, if the requesting node 102, 104already has a copy of the memory line of information, the RPE 124 of therequesting node sends an “exclusive request” to the home node 102, 104instead of a “read-exclusive request.” If the requesting node 102, 104is unambiguously listed as a sharer node 102, 104 in the entry 182 ofthe directory 180, the steps are the same as those described above withreference to FIGS. 12A-12D, with the exception that the home node 102,104 does not include the memory line of information 184 with theexclusive reply (a protocol message sent instead of a read-exclusivereply).

A given node is unambiguously listed as a sharer node if thesharer-information field 188 is in the limited-pointer format andincludes the identifier of the given node or in coarse-vector format andonly the requesting node is associated with a particular set bit. Thus,a given node is not unambiguously listed as a sharer node 102, 104 if(1) the sharer-information field 188 is in the limited-pointer formatbut does not include the identifier of the given node, or (2) thesharer-information field 188 is in the course-vector format and the bitassociated with the given node 102, 104 is also associated with othernodes.

If the requesting node 102, 104 is not unambiguously listed as a sharernode 102, 104 in the entry 182 of the directory 180, the HPE 122converts the exclusive request to a read-exclusive request, which isthen processed as described above. Alternatively, the HPE 122 sends aprotocol message to the RPE 124 at the requesting node 102, 104directing it to send a read-exclusive request to the home node. Inanother alternate embodiment, the RPE of the requesting node isconfigured to recognize when the number of nodes in the system issufficiently great that the coarse vector bit used to represent therequesting node in the sharer information field 188 of directory entriesalso represents at least one other node. In this alternate embodiment,the RPE of the requesting node is further configured to not sendexclusive requests when it recognizes, detects or knows this of thissystem status, and to instead send a read-exclusive request. In otherwords, in this situation the “exclusive request” optimization issuppressed or not used.

FIG. 13 illustrates steps taken to support a write-back request protocolmessage. A write-back request is initiated by a PC 106 when, forexample, space is needed in the caches 110, 114 (step 1300). As anexception to the general rule described above, the write-back request isa high-priority protocol message. This exception is required because ofa potential for the race condition described below.

The request is routed to the RPE 124, which responds by adding an entry210 in the TSRF 202 (step 1302) and sending a write-back request to thehome node 102, 104 (step 1304). The entry 210 indicates that awrite-back acknowledgment is required to advance the memory transactionto a next state. Additionally, the RPE 124 maintains the memory line ofinformation 184 until the write-back acknowledgment is received and, ifnecessary, a forwarded request is received. If a forwarded request isreceived (e.g., read forward), it is handled as described above;however, the RPE 124 updates the state of the TSRF entry 210 to indicatethat the forwarded request was received.

Upon being received at the home node 102, 104, the write-back request isrouted to the HPE 122 (step 1306) of the home node, which responds byadding an entry 210 in the TSRF 202 (step 1308). HPE 122 responds bychecking the state of the memory line (step 1310). In particular, theHPE 122 determines if the directory entry 182 corresponding to thememory line of information still indicates that the “owner” node 102,104 is the owner of the memory line of information 184. If so (step1312-Yes), the HPE 122 updates the memory line of information 184 in thememory subsystem 123 (step 1314) and the state of the associateddirectory entry to indicate that the memory line of information 184 isno longer shared or owned by the former owner node 102, 104 (step 1316).HPE 122 then sends a write-back acknowledgment to the former owner node102, 104 indicating that the memory transaction was successful (step1318). The HPE then removes the TSRF entry 210 related to this memorytransaction (step 1320).

If the directory entry 182 corresponding to the memory line ofinformation does not indicate that the “owner” node 102, 104 is theowner of the memory line of information 184 (step 1312-No), HPE 122sends a write-back acknowledgment to the former owner node 102, 104indicating that the write-back request was stale (i.e., that the memorytransaction was not successful) (step 1318). More specifically, thewrite-back acknowledgment indicates that the home node 102, 104forwarded a request related to the memory line of information 184 to theformer owner node 102, 104 before receiving the write-back request. TheHPE then removes the TSRF entry 210 related to this memory transaction(step 1320).

Upon receiving the write-back acknowledgment (step 1324), the RPE 124 ofthe former owner node determines if a race condition exists and whetherit has been satisfied. As noted above, the write-back acknowledgmentwill indicate whether a race condition exists (i.e., whether the homenode has forwarded a request related to the memory line that is thesubject of the write-back request). The TSRF entry 210 in the RPE of theformer owner node will indicate if the forwarded request has alreadybeen received and processed by the former owner node 102, 104. If so,the RPE 124 removes the TSRF entry 210 for the memory transaction (step1326). If not, the RPE 124 updates the state of the TSRF entry 210 toindicate that the forwarded request is required in order to advance thestate of the memory transaction to a final state, and thus remove theTSRF entry 210.

Limited Fanout Daisy-Chaining Invalidation Requests

In the above described embodiments, the home node 102, 104 always sendsinvalidation requests to sharer nodes 102, 104 individually. Each sharernode 102, 104 then sends an invalidation acknowledgment to therequesting node 102, 104. Accordingly, the maximum number ofinvalidation requests and invalidation acknowledgments is entirelydependent upon the number of nodes 102, 104 sharing a given memory lineof information 184 and bound only by the number of nodes 102, 104 in themultiprocessor system 100. To reduce the number of protocol messages(e.g., invalidation requests and invalidation acknowledgments) active atany given moment, the invention configures directory entries (see FIG. 4and the above discussion of the directory data structure 180) using theabove described limited-pointer format and coarse-vector format, andfurthermore employs a limited fanout, daisy-chaining invalidationmethodology that ensures that no more than a specified number ofinvalidation requests and invalidation acknowledgments are active at anygiven moment, which avoids deadlocks.

The maximum number of invalidation requests and acknowledgments,resulting from a request for exclusive ownership of a particular memoryline, that are active at any given moment is herein called the maximumfanout. In the preferred embodiments, the maximum fanout is a numberbetween four and ten. The protocol engines of the present invention areconfigured to ensure that the number of invalidation requests and/oracknowledgments simultaneously active in a system as a resulting of asingle a request for exclusive ownership of a particular memory linenever exceeds the maximum fanout.

In preferred embodiments, the maximum number of invalidation requestsand invalidation acknowledgments is set to four. Thus, thesharer-information field 188 of each directory entry 182 (FIG. 4) isconfigured to identify a maximum of DP (e.g. four) nodes when using thelimited-pointer format. Similarly, the bits (e.g., 40-bits) of thesharer-information field 188 are grouped into DP (e.g., four) groups(e.g., 10-bit groups) when in the coarse-vector format. While theoperation of the invention will be described with respect to anembodiment in which the sharer-information field 188 contains fourgroups of 10-bits for a total of 40 bits, in other embodiments the totalnumber of bits in the sharer-information field, the number of groups ofbits, and the number of bits per group, may vary substantially fromthose used in the preferred embodiment.

As described in more detail below, the home node 102, 104 sends at mostone invalidation request for each of the four 10 bit groups. Inparticular, the home node sends an invalidation request to the firstnode, if any, identified as being a potential sharer by each 10-bitgroup within the sharer-information field. Thus, a home node 102, 104sends at most four invalidation request messages to other nodes.Further, a subsequent set of invalidation request messages, if needed,are sent by the nodes that receive the initial invalidation requestmessages, this time to the second node, if any, identified as being apotential sharer by each respective 10-bit group within thesharer-information field. This process is repeated by each nodereceiving an invalidation request until the last node identified asbeing a potential sharer by each respective 10-bit group within thesharer-information field has received an invalidation request. Only thelast identified node for each respective 10-bit group sends aninvalidation acknowledgment to the requesting node 102, 104. Using thislimited fanout, daisy chaining-like methodology, the maximum number ofinvalidation request messages and invalidation acknowledgment messagesthat are active at any one time as the result of a request for exclusiveownership of a particular memory line never exceeds four, which is themaximum fanout in a preferred embodiment. In other preferred embodiment,the maximum fanout varies from four to ten.

In some embodiments of the present invention, the bits are grouped, forexample, as follows: the first 10-bits, the second 10-bits, the third10-bits, and the fourth 10-bits of a 40-bit sharer-information field 188are groups 1-4 respectively. But in preferred embodiments of theinvention, the bits within each group are interleaved. Specifically, inthe preferred embodiment, the bits (and table 189 columns) 0, 4, 8, 12,16, 20, 24, 28, 32, and 36 form one group; bits (and table 189 columns)1, 5, 9, 13, 17, 21, 25, 29, 33, and 37 form a second group; bits (andtable 189 columns) 2, 6, 10, 14, 18, 22, 26, 30, 34, and 38 form a thirdgroup; bits (and table 189 columns) 3, 7, 11, 15, 19, 23, 27, 31, 35,and 39 form a fourth group.

Though group identifiers (e.g., first group, second group, etc.) are notrequired for a node 102, 104 to determine which group it is in (sinceeach node 102, 104 has access to its identifier) the number of bitgroups and the number of bits in the sharer-information field 188 arerequired to establish the bit membership of each group (i.e., todetermine the position of the bits of a given group within thesharer-information field 188) or equivalently, to establish the identityof a first node 102, 104 associated with each bit and additional nodes102, 104 associated with each bit of a given group.

This aspect of the invention is now described in greater detail withreference to FIGS. 14A and 14B. The steps taken by the home node 102,104 before and after an invalidation request is sent to a sharer node102, 104 as described above are not changed in this embodiment of theinvention.

In a first step, the home node 102, 104 determines the state of a givenmemory line of information 184 by reference to a corresponding directoryentry 180 (step 1402). As described above, each directory entry 180includes a state field 186, which is preferably set to one of fourvalues—including invalid, exclusive, shared, and shared-cv. Accordingly,this determination is made by reference to the state field 186. If thestate field 186 is set to shared, the format of the sharer-informationfield 188 is the limited-pointer format. If, however, the state field isset to shared-cv, the format of the sharer-information field 188 is thecoarse-vector format.

If the state field 186 indicates that the sharer-information field 188is in the limited-pointer format (step 1406-Yes), the home protocolengine 122 extracts the node identifiers directly from each of the foursub-fields of the sharer-information field 188 (step 1410). The nodeidentifier in each sub-field is valid if it is not the predefined nullidentifier. As noted above, in preferred embodiments the null identifiervalue is zero. The home protocol engine 122 then sends an invalidationrequest to each node 102, 104 identified in the sharer-information field188 as a sharer node 102, 104 (step 1414).

If, however, the state field 186 indicates that the sharer-informationfield 188 is in the coarse-vector format (step 1406-No), the homeprotocol engine 122 identifies for each group of bits within thesharer-information field 188 the first set bit (step 1418). Note that itis possible that one or more the groups may have no bits that are set.

Once the first set bit, if any, in each group of bits is identified, thehome protocol engine 122 identifies the first node 102, 104 thatcorresponds to each of the identified first-set-bits using thetechniques described above (step 1422). The above described techniquesare extended somewhat in preferred embodiments however. If the firstnode 102, 104 that corresponds to a given identified first-set-bit isthe requesting node or the home node, the home protocol engine 122identifies the second node 102, 104 that corresponds to the identifiedfirst-set-bit. This step is repeated until a node 102, 104 that isneither the home node nor the requesting node is identified. If it isdetermined that none of the set bits in the group correspond to a nodeother than the home node and requesting node, an invalidation request isnot sent by the home node for this particular group of bits in thesharer-information field 188. In alternative embodiments, this step isnot taken by the home node 102, 104. Instead, the HPE 122 of the homenode and the RPE 124 of the requesting node are configured to processthese messages as described above without ever responsively invalidatingthe memory line of information 184.

Once one or more nodes 102, 104 are identified (i.e., up to one node pergroup of bits in the sharer-information field of the directory entry),the home protocol engine 122 sends an invalidation request to each ofthe identified nodes 102, 104 (step 1426). Included each invalidationrequest is a sharer group field containing the 10-bit group of bitsassociated with the designated recipient of a given invalidation requestand possibly an identifier of the 10-bit group. (The sharer group fieldis not included in an invalidation request if the sharer-informationfield 188 is not in the coarse-vector format.) This sharer group fieldis required because the sharer nodes do not maintain information aboutthe nodes 102, 104 that share a given memory line of information 184.The 10-bit group of sharer information that is sent along with theinvalidation request permits each node that receives the invalidationrequest to identify the next node 102, 104 to receive an invalidationrequest as described above or to determine that there is no next node102, 104 (i.e., that an invalidation acknowledgment should be sent tothe requesting node 102, 104).

Additionally, the group identifier of the 10-bit group permits thesharer node 102, 104 to identify the position of each bit within the10-bit group in the sharer-information field 188, which also permits thesharer node 102, 104 to identify the next node 102, 104 (if any) toreceive the invalidation request, as described above, or to determinethat there is no next node 102, 104. In an alternate embodiment, thegroup identifier is not included in the invalidation request and insteadthe protocol engines in each node are programmed to know the sharergroup in which each such node resides. Since all the invalidationrequests received by any particular node would always have the samesharer group identifier, the sharer group identifier is not strictlyneeded.

Upon receiving an invalidation request (step 1430) and adding a relatedentry 210 in the TSRF 202 (step 1432), a sharer node 102, 104 determinesa next node, if any, by analyzing the sharer group field of theinvalidation request. If all of the bits of the sharer group field areset to zero, there is no sharer information in the request (1434-No) andtherefore there is no next node to which to send the invalidationrequest. Instead, the remote protocol engine 124 in the sharer node 102,104 sends an invalidation acknowledgment to the requesting node (step1438). The sharer-node then processes the invalidation request asdescribed above with reference to step 1238 (step 1458).

If the sharer group field in the received invalidation request includesany set bits (i.e., includes sharer information) (step 1434-Yes), theremote protocol engine 124 in the sharer node 102, 104 determines thenext node, if any, to receive an invalidation request (step 1442).

The remote protocol engine in the sharer node identifies the next nodeby first determining the bit in the sharer group field that correspondsto the node identifier of the sharer node, and then determining if thereis a next node (e.g., with a higher node identifier) that (A) alsocorresponds to that same bit of the sharer group field, and (B) isneither the home node (which is identified by the address of the memoryline to be invalidated) nor the requesting node (which is identified bya requesting node field in the invalidation request). If not, the remoteprotocol engine looks for a next set bit (if any) in the sharer groupfield and determines if that next set bit corresponds to a node 102, 104that is neither the home node 102, 104 nor the requesting node 102, 104.This process continues, processing the bits of the sharer group field ina predetermined order (e.g., from left to right) until the remoteprotocol engine either identifies a next node, or determines that thereis no next node.

If a valid next node 102, 104 is identified (step 1446-Yes), the sharernode 102, 104 sends an invalidation request to the next node (step1450). The sharer node 102, 104 includes in this invalidation requestthe same 10-bit sharer group field (and possibly a group identifier)that was included in the invalidation request received by the sharernode 102, 104. The sharer node 102, 104 then processes the invalidationrequest as described above with reference to step 1238 (step 1458). Thesharer node 102, 104 then removes the related entry 210 from the TSRF202 (step 1460).

If, a valid next node is not identified (step 1446-No), this means thatthe sharer node is the last node in the invalidation request daisychain. In this case the sharer node sends an invalidation acknowledgmentto the requesting node (step 1454). The sharer node then processes theinvalidation request as described above with reference to step 1238(step 1458). The sharer node 102, 104 then removes the related entry 210from the TSRF 202 (step 1460).

Because each of the bits of the sharer group field may be associatedwith more than one nodes, the remote protocol engines in the nodes ofthe system are unable to determine which of the associated nodes (otherthan itself) are actually sharer nodes. When a node receives aninvalidation request for a memory line of information 184 that it doesnot share, the node nevertheless sends an invalidation request (step1450) or acknowledgment (step 1454) as described above. However, theprocessing of the received invalidation request at step 1458 comprisesdetermining that the node is not a sharer of the specified memory line,and therefore no cache lines in the node are invalidated in response tothe received invalidation request.

In other preferred embodiments, the bits of the sharer information fieldof the directory entries are divided into a larger number of groups ofbits (e.g., four to ten groups). The number of such groups of bitscorresponds to the maximum fanout of the daisy chained invalidationmessages in these embodiments.

Invalid-to-Dirty Memory Transactions

The present invention includes the cache coherence protocol (CCP)described in detail above with an extension to support invalid-to-dirtymemory transactions. As noted above, memory transactions involve memorylines of information. The memory lines of information comprise a portionof memory subsystem 123 and possibly one or more of the memory cachesillustrated in FIGS. 1 and 2.

During a memory transaction that results in a write to a memory line ofinformation, only a portion of the memory line of information mayactually be written to. In a preferred embodiment of the presentinvention, however, a node 102, 104 cannot obtain exclusive ownership ofonly a portion of a memory line of information. Though technicallypossible, doing so would be too expensive. The system would need tosupport a greater number of exclusive owners (e.g., one node that ownsfour portions of a memory line of information would be equivalent tofour separate nodes owning the four portions), so the amount of memoryrequired to track exclusive owners would increase. Additionally, a nodeseeking exclusive ownership of more than just a portion of a memory lineof information would have to go through the process of obtainingexclusive ownership for each portion. Accordingly, ownership of anentire memory line of information must be obtained regardless of howmuch of the memory line of information will be written to.

But there are instances in which a processor will overwrite an entirememory line of information (i.e., all the bytes of the entire memoryline at a particular memory line address) without regard to its currentcontents. In these instances, obtaining an up-to-date copy of a memoryline of information is unnecessary. Accordingly, preferred embodimentsof the present invention are configured to support invalid-to-dirtymemory transactions.

An invalid-to-dirty memory transaction enables exclusive ownership of amemory line of information (and thus the ability to overwrite the memoryline of information) without the need to obtain, and therefore routeacross one or more nodes 102, 104, an up-to-date copy of the memory lineof information.

The “invalid” portion of the phrase “invalid-to-dirty” refers to thestatus of a node's cached copy of a memory line of information prior toobtaining exclusive ownership of the memory line of information. The“dirty” portion of the phrase “invalid-to-dirty” refers to the status ofthe cached copy of the memory line of information after obtaining, andwhile maintaining, exclusive ownership of the memory line ofinformation. The memory line of information is itself “dirty” (i.e.,assumed to have been modified in value) because the owner has the rightto overwrite the contents of the memory line of information.

When a home node receives an invalid-to-dirty request and an owner nodeis designated as an exclusive owner of the memory line of informationthat is the subject of the invalid-to-dirty request, the copy of thememory line of information cached by the owner node must be invalidated.As described above, invalidation requests are sent only to sharer nodes(i.e., nodes caching a shared copy of a given memory line ofinformation) in response to a read-exclusive or exclusive request.

Furthermore, as described above, race conditions often occur. Forexample, a node may be waiting for a response to an outstanding requestto obtain exclusive ownership of a given memory line of information whenan invalidation request concerning the same memory line of informationis received. Because invalidation requests are not sent to owner nodes,the node receiving this request can safely assume that the invalidationrequest was processed before the outstanding request. Accordingly, theinvalidation request is acknowledged immediately, but has no effect onthe memory line of information cached locally.

As noted above, however, an invalid-to-dirty memory transaction requiresthe invalidation of any copy of a given memory line of information,whether the node receiving the invalidation request is caching a sharedcopy of the memory line of information or is the exclusive owner of thememory line of information. To avoid ambiguity with invalidationrequests sent to sharer nodes, a different type of invalidation request(i.e., an invalid-to-dirty invalidation request) is sent to exclusiveowners of a given memory line of information. This makes it clear thatany outstanding request by the exclusive owner node was processed beforethe invalid-to-dirty invalidation request. The invalidation requesttherefore affects the memory line of information cached locally (i.e.,results in its invalidation).

The invalid-to-dirty memory transaction is now discussed in greaterdetail with reference to FIGS. 15A-15C. In a first step, a processorcore (PC) 106 (FIG. 1) issues a write request for an entire memory lineof information (FIG. 15A, step 1500), which is routed to the remoteprotocol engine (RPE) 124 (FIG. 1) for processing (FIG. 15A, step 1502).In preferred embodiments of the present invention, the message-type ofthe request issued by the PC 106 unambiguously indicates that an entirememory line of information will be overwritten. For example, the Alpha21364, which as noted above is a type of processor core 106, supportswrite requests of varying, but specified, sizes.

The RPE 124 then adds an entry 210 in the TSRF 202 (step 1504) of theRPE 124 (see FIGS. 5 and 6B). As noted above, the new entry 210 includesinformation about the associated memory transaction.

The RPE then updates the associated entry 210 in the TSRF 202 toindicate a set of one or more protocol messages required to advance thememory transaction to a next state (step 1506). (Steps 1504 and 1506 maybe combined into a single operation.) As described below, aninvalid-to-dirty request can result in an invalid-to-dirty invalidationreply (from the owner node to the requesting node), an exclusive reply(from the home node to the requesting node), and zero or moreinvalidation acknowledgments (from sharer nodes to the requesting node,in response to the home node sending invalidation requests to the nodesthat share the memory line).

The RPE then sends an invalid-to-dirty request to the home node for thememory line that is the subject of the memory transaction. Theidentification of the home node is extracted from the address of thememory line of information that is the subject of this memorytransaction (step 1510).

The invalid-to-dirty request is received by the home node, and routedinternally as described above to the home protocol engine (HPE) 122(FIG. 15B, step 1518) at the home node of the memory line that is thesubject of the memory transaction. The HPE 122 responds by adding anentry 210 in the TSRF 202 (step 1520) of the HPE, and checking the stateof the memory line of information in a corresponding entry 182 in thedirectory 180 of the home node's memory subsystem (step 1522) (see FIG.4).

If the entry 182 indicates that a node has an exclusive copy of thememory line of information (step 1524-No), the HPE 122 sends aninvalid-to-dirty invalidation request to the node designated in thedirectory as exclusive owner of the memory line of information that isthe subject of the memory transaction (step 1526).

The HPE 122 also updates the state of the memory line of information(step 1528). Specifically, the HPE 122 modifies the sharer-informationfield 188 in the directory entry 182 corresponding to the memory line ofinformation that is the subject of the current memory transaction toindicate that the requesting node 102, 104 is exclusive owner of thememory line of information.

Further, the HPE removes the TSRF entry 210 added to the TSRF 202 instep 1520 (step 1529). The removal of this TSRF entry 210 indicates thatfrom the perspective of the home node, the invalid-to-dirty memorytransaction is complete.

If the entry 182 does not indicate that a node has an exclusive copy ofthe memory line of information (step 1524-No), the HPE 122 treats therequest as an “ordinary” exclusive request (step 1525). In particular,the HPE 122 sends an exclusive reply to the requesting node (step 1525).Further, the HPE 122 sends zero or more invalidation request to thenodes, if any, designated in the directory entry corresponding to thememory line of information as sharer nodes (step 1525). Note that thecount of such nodes is included in the exclusive reply so that therequesting node knows how many invalidation acknowledgments, if any, therequesting node is to receive. The exclusive reply sent to therequesting node indicates to the requesting node that it has beendesignated exclusive owner of the memory line of information. Thus, theHPE 122 also updates the state of the memory line of information toindicate that the requesting node is exclusive owner of the memory lineof information (step 1528). Further, the HPE 122 removes the TSRF entry210 added to the TSRF 202 in step 1520 (step 1529). The removal of thisTSRF entry 210 indicates that from the perspective of the home node, theinvalid-to-dirty memory transaction is complete. The processing stepsassociated with an exclusive request, such as the steps taken when arequesting node receives an exclusive reply and one or more invalidationacknowledgments, are described in greater detail above with reference toFIGS. 12A-12D.

The invalid-to-dirty invalidation request is received by the owner nodeand routed internally as described above to the RPE 124 (FIG. 15C, step1530). The RPE 124 responds by adding an entry 210 in the TSRF (step1532) and checking the TSRF for outstanding requests concerning thememory line of information (step 1534).

As noted above, it is possible that the owner node has not yet receiveda response to an issued request for exclusive ownership of the memoryline of information. In other words, the home node recognizes the ownernode, but the owner node 102, 104 does not know that it is the ownernode.

If the RPE 124 determines that there is an outstanding requestconcerning the memory line of information (step 1534-Yes), the RPE 124updates the TSRF entry 210 (step 1536) to indicate that a response tothe outstanding request must be received and processed (step 1538)before the current memory transaction can advance. In preferredembodiments, possible responses to the outstanding request include anexclusive-reply, a read-exclusive reply, one or more invalidationacknowledgments, and an invalid-to-dirty invalidation reply. In the caseof multiple responses (e.g., read-exclusive reply plus one or moreinvalidation acknowledgments), the invalid-to-dirty invalidation requestreceived at step 1530 can not be processed until all of these messagesare received and processed by the owner node.

After processing the response(s) to the outstanding request or if theRPE 124 determined that there were no outstanding requests concerningthe memory line of information (step 1534-No), the RPE 124 processes theinvalid-to-dirty invalidation request (sent by the home node in step1526) by sending an invalid-to-dirty invalidation reply to therequesting node (step 1540). Note that the owner node does not updatethe memory line of information at the home node and does not supply an‘up-to-date’ copy of the memory line of information to the requestingnode. Again, the requesting node has enough new data to overwrite theentire contents of the memory line of information, so this informationis not needed.

The RPE 124 of the owner node also invalidates the local copy of thememory line of information (step 1542) and removes the TSRF entry 210(step 1544), which signals the end of this memory transaction from theperspective of the owner node.

The invalid-to-dirty invalidation reply is received by the requestingnode and routed internally as described above to the RPE 124 of therequesting node (FIG. 15A, step 1550). The RPE 124 responds by signalingthe completion of the memory transaction to the PC 106 that issued thewrite request for the memory line of information (step 1552) andremoving the corresponding TSRF entry 210 from the TSRF 202 (step 1554),which signals the end of this memory transaction from the perspective ofthe RPE 124. At this point, the PC 106 can overwrite the contents of thememory line, having gained exclusive ownership of the memory line.

Alternate Embodiments

While the present invention has been described with reference to a fewspecific embodiments, the description is illustrative of the inventionand is not to be construed as limiting the invention. Variousmodifications may occur to those skilled in the art without departingfrom the true spirit and scope of the invention as defined by theappended claims.

What is claimed is:
 1. A multiprocessor computer system including aplurality of nodes, each node including an interface to a local memorysubsystem, the local memory subsystem storing a multiplicity of memorylines of information and a directory; a memory cache for caching amultiplicity of memory lines of information, including memory lines ofinformation stored in a remote memory subsystem that is local to anothernode; a protocol engine implementing a negative acknowledgment freecache coherence protocol, the protocol engine including a memorytransaction array for storing an entry related to a memory transaction,the entry including a memory transaction state, the memory transactionconcerning a memory line of information; and logic for processing thememory transaction, including advancing the memory transaction whenpredefined criteria are satisfied and storing a state of the memorytransaction in the memory transaction array; the protocol engine of arequesting node being configured to support memory transactionsconcerning a request for exclusive ownership of an identified memoryline of information having a home address located in the remote memorysubsystem that is local to another node, wherein the entire identifiedmemory line of information is to be overwritten by the requesting nodeafter exclusive ownership of the memory line of information is grantedand an up-to-date copy of the memory line of information is not requiredin a response to the request for exclusive ownership of the identifiedmemory line of information.
 2. The system of claim 1, wherein theprotocol engine of the requesting node is configured to process thememory transaction concerning the request for exclusive ownership of thememory line of information by sending a first protocol message to afirst node in the plurality of nodes; and storing in the memorytransaction array a state of the memory transaction, the stateindicating a second protocol message that will advance the memorytransaction to a next state, receipt of the second protocol messagebeing a predefined criterion for advancing the memory transaction to thenext state.
 3. The system of claim 2, wherein the first protocol messageis an invalid-to-dirty request for a memory line of information storedin the local memory subsystem at the first node; and the second protocolmessage is a invalid-to-dirty invalidation reply.
 4. The system of claim2, wherein a protocol engine included in the first node is configured torespond to the first protocol message by determining if a directoryentry, in the directory in the memory subsystem local to the first node,indicates that a second node in the plurality of nodes is exclusiveowner of the memory line of information; modifying said directory entryto indicate that the requesting node is exclusive owner of the memoryline of information; and sending an invalid-to-dirty invalidationrequest to the second node.
 5. The system of claim 4, wherein theprotocol engine included in the second node is configured to respond tothe invalid-to-dirty invalidation request by sending theinvalid-to-dirty invalidation reply to the requesting node.
 6. Thesystem of claim 4, wherein the protocol engine included in the secondnode is configured to respond to the invalid-to-dirty invalidationrequest by invalidating a local copy of the identified memory line ofinformation.
 7. The system of claim 4, wherein the protocol engineincluded in the second node is configured to execute a delay incompleting a response to the invalid-to-dirty invalidation request untilthe protocol engine included in the second node receives a response toan outstanding memory transaction related to the identified memory lineof information.
 8. The system of claim 7, wherein the outstanding memorytransaction related to the identified memory line of information is arequest for exclusive ownership of the identified memory line ofinformation.
 9. The system of claim 7, wherein the protocol engineincluded in the second node is configured to execute the delay byupdating an entry relating to the invalid-to-dirty invalidation requestin the memory transaction array, wherein the protocol engine included inthe second node subsequently accesses said entry to complete theresponse to the invalid-to-dirty invalidation request.
 10. The system ofclaim 1, wherein the protocol engine of the requesting node isconfigured to process the memory transaction concerning the request forexclusive ownership of the memory line of information by sending a firstprotocol message to a first node in the plurality of nodes; and storingin the memory transaction array a state of the memory transaction, thestate indicating a set of one or more second protocol messages requiredto advance the memory transaction to a next state.
 11. The system ofclaim 10, wherein the first protocol message is an invalid-to-dirtyrequest for a memory line of information having a home address locatedin the memory subsystem local to the first node; and the one or moresecond protocol messages include an exclusive reply and zero or moreinvalidation acknowledgments.
 12. The system of claim 10, wherein theprotocol engine in the first node is configured to respond to the firstprotocol message by determining if a directory entry, in the directoryin the memory subsystem local to the first node, indicates that one ormore of the plurality of nodes, excluding the first node and therequesting node, have a shared copy of the memory line of information;sending an invalidation request to the one or more of the plurality ofnodes; sending an exclusive reply to the requesting node, the exclusivereply including a count of the one or more of the plurality of nodes;and modifying said directory entry to indicate that the requesting nodeis exclusive owner of the memory line of information.
 13. The system ofclaim 12, wherein the protocol engine included in each of the one ormore of the plurality of nodes is configured to respond to theinvalidation request by invalidating a local copy of the memory line ofinformation; and sending an invalidation acknowledgment to therequesting node.
 14. The system of claim 1, wherein the logic forprocessing the memory transaction includes a mechanism for determiningwhether the request for exclusive ownership of the identified memoryline of information is to result in the entire memory line ofinformation being overwritten after exclusive ownership of the memoryline of information is granted.
 15. The system of claim 14, wherein themechanism reads a message type included in the request for exclusiveownership of the identified memory line of information to determinewhether the entire memory line of information is to be overwritten. 16.The system of claim 14, wherein the logic is configured to send aninvalid-to-dirty request to a first node, said first node storing theidentified memory line of information in a memory subsystem that islocal to the first node, if the logic determines that the request forexclusive ownership is to result in the entire memory line ofinformation being overwritten after exclusive ownership of the memoryline of information is granted.
 17. The system of claim 14, wherein thelogic is configured to send a read-exclusive request to a first node,said first node storing the identified memory line of information in amemory subsystem that is local to the first node, if the logicdetermines that the request for exclusive ownership is not to result inthe entire memory line of information being overwritten after exclusiveownership of the memory line of information is granted.
 18. The systemof claim 1, wherein an entire identified memory line of informationincludes each byte of memory associated with a single, unique memoryline of information address.
 19. A multiprocessor computer systemincluding a plurality of nodes, each node including an interface to alocal memory subsystem, the local memory subsystem storing amultiplicity of memory lines of information and a directory; a memorycache for caching a multiplicity of memory lines of information,including memory lines of information stored in a remote memorysubsystem that is local to another node; a protocol engine implementinga negative acknowledgment free cache coherence protocol, the protocolengine including a memory transaction array for storing an entry relatedto a memory transaction, the entry including a memory transaction state,the memory transaction concerning a memory line; logic for processingthe memory transaction, including advancing the memory transaction whenpredefined criteria are satisfied and storing a state of the memorytransaction in the memory transaction array; the protocol engineconfigured to support an invalid-to-dirty memory transaction, whereinthe protocol engine included in a first node from the plurality of nodesis configured to sends an invalid-to-dirty request to a second node fromthe plurality of nodes, said invalid-to-dirty request identifying amemory line of information stored in the remote memory subsystem that islocal to the second node; the protocol engine included in the secondnode is configured to send an invalid-to-dirty invalidation request to athird node from the plurality of nodes in response to theinvalid-to-dirty request if the third node has previously beendesignated as exclusive owner of the memory line; the protocol engineincluded in the second node is configured to designate the first node asexclusive owner of the memory line of information in response to theinvalid-to-dirty request; the protocol engine included in the third nodeis configured to respond to the invalid-to dirty invalidation request byinvalidating a copy of the memory line of information cached in thememory cache in response to the invalid-to-dirty invalidation requestand sending an invalid-to-dirty invalidation reply to the first node.20. The system of claim 19, wherein the protocol engine included in thefirst node determines that the memory line of information is to beentirely overwritten, so that an up-to-date copy of the memory line ofinformation is not required by the first node, before sending theinvalid-to-dirty request.
 21. The system of claim 20, wherein theprotocol engine included in the first node is configured to send anexclusive request to the second node if the first node determines thatthe memory line of information is not to be entirely overwritten andthat the first node has a valid copy of the memory line of informationcached in the memory cache.
 22. The system of claim 20, wherein theprotocol engine included in the first node is configured to send aread-exclusive request to the second node if the first node determinesthat the memory line of information is to be entirely overwritten andthat the first node does not have a valid copy of the memory line ofinformation cached in the memory cache.
 23. The system of claim 19,wherein the protocol engine included in the second node is configured todetermine that the third node is exclusive owner of the memory line ofinformation by reference to the directory before sending theinvalid-to-dirty invalidation request, said directory including statusinformation for the multiplicity of memory lines of information.
 24. Thesystem of claim 23, wherein the protocol engine included in the secondnode is configured to send an exclusive reply to the first node and aninvalidation request to zero or more other nodes from the plurality ofnodes if the first node determines that no node is designated asexclusive owner of the memory line and at least one of said other nodesis caching a copy of the memory line of information.
 25. The system ofclaim 19, wherein the protocol engine included in the third node isconfigured to determine that the third node is not waiting to process aresponse to an outstanding request concerning the memory line ofinformation before sending an invalid-to-dirty invalidation reply to thefirst node and invalidating a copy of the memory line of informationcached in the memory cache.
 26. The system of claim 25, wherein theprotocol engine included in the third node is configured to update anentry of the memory transaction array relating to the invalid-to-dirtyinvalidation request if the third node determines that the third node iswaiting to process the response to the outstanding request, said entryindicating that the response to the outstanding request must beprocessed before the invalid-to-dirty memory transaction is advanced.27. The system of claim 26, wherein the protocol engine included in thethird node is configured to access said entry of the memory transactionarray to advance the invalid-to-dirty memory transaction afterprocessing the outstanding request.
 28. The system of claim 26, whereinadvancing the invalid-to-dirty memory transaction includes sending aninvalid-to-dirty invalidation reply to the first node and invalidating acopy of the memory line of information cached in the memory cache. 29.The system of claim 26, wherein the outstanding request includes arequest for exclusive ownership of the memory line.
 30. The system ofclaim 29, wherein the response to the outstanding request comprises aread-exclusive reply and zero or more invalidation acknowledgments. 31.The system of claim 29, wherein the response to the outstanding requestcomprises an exclusive reply and zero or more invalidationacknowledgments.
 32. The system of claim 30, wherein the response to theoutstanding request comprises an invalid-to-dirty invalidation reply.33. The system of claim 26, wherein the protocol engine included in thethird node is configured to add an entry relating to theinvalid-to-dirty invalidation request to the memory transaction arrayafter receiving the invalid-to-dirty invalidation request.
 34. Thesystem of claim 33, wherein the protocol engine included in the thirdnode is configured to remove the entry from the memory transaction arrayafter sending an invalid-to-dirty invalidation reply to the first nodeand invalidating a copy of the memory line of information cached in thememory cache.
 35. The system of claim 19, wherein the invalid-to-dirtymemory transaction is triggered by a write request from a processorincluded in the first node, said request being routed to the protocolengine included in the first node; and the protocol engine sends anotification to the processor after the first node receives theinvalid-to-dirty reply, said notification indicating that the processormay write the memory line.
 36. The system of claim 35, wherein theprotocol engine included in the first node is configured to add an entryrelating to the write request to the memory transaction array afterreceiving the write request.
 37. The system of claim 36, wherein theprotocol engine included in the first node is configured to update saidentry of the memory transaction array after the first node determinesthat the memory line of information is to be entirely overwritten, suchthat the entry identifies one or more responses relating to the writerequest that will advance the invalid-to-dirty memory transaction. 38.The system of claim 37, wherein the one or more responses include aresponse selected from the set consisting of an invalid-to-dirtyinvalidation reply, an exclusive reply, and zero or more invalidationacknowledgments.
 39. The system of claim 36, wherein the protocol engineincluded in the first node is configured to remove the entry from thememory transaction array after receiving the invalid-to-dirtyinvalidation reply.
 40. The system of claim 19, wherein the protocolengine included in the second node is configured to add an entryrelating to the invalid-to-dirty request to the memory transaction arrayafter receiving the invalid-to-dirty request.
 41. The system of claim40, wherein the protocol engine included in the second node isconfigured to remove said entry from the memory transaction array aftersending the invalid-to-dirty invalidation request to the third node anddesignating the first node as exclusive owner of the memory line.